# Show_simpleMath.py # Charles Van Loan # January 1, 2015 """ Module contains a script that uses the built-in module math and the user-written module simpleMath. It compares the accuracy of the simpleMath functions sqrt, cos, and sin with their counterparts in the math module""" import math import simpleMath # Check out the square root function x = input('x = ') MySqrt = simpleMath.sqrt(x) TrueSqrt = math.sqrt(x) print 'simpleMath.sqrt(x) = %12.8f\n math.sqrt(x) = %12.8f \n' % (MySqrt,TrueSqrt) theta = input('theta (degrees) = ') theta = (math.pi*theta)/180 MyCos = simpleMath.cos(theta) TrueCos = math.cos(theta) MySin = simpleMath.sin(theta) TrueSin = math.sin(theta) print 'simpleMath.cos(theta) = %12.8f\n math.cos(theta) = %12.8f ' % (MyCos,TrueCos) print 'simpleMath.sin(theta) = %12.8f\n math.sin(theta) = %12.8f ' % (MySin,TrueSin)