Update math.cpp

New function added