modified test_math.cpp