Update calc.cpp

Included sub function.