Update calc.cpp

Added a new meethod