Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c045b49 commit 64108afCopy full SHA for 64108af
1 file changed
Lib/test/test_math.py
@@ -57,6 +57,11 @@ def testit(name, value, expected):
57
testit('cosh(0)', math.cosh(0), 1)
58
testit('cosh(2)-2*cosh(1)**2', math.cosh(2)-2*math.cosh(1)**2, -1) # Thanks to Lambert
59
60
+print 'degrees'
61
+testit('degrees(pi)', math.degrees(math.pi), 180.0)
62
+testit('degrees(pi/2)', math.degrees(math.pi/2), 90.0)
63
+testit('degrees(-pi/4)', math.degrees(-math.pi/4), -45.0)
64
+
65
print 'exp'
66
testit('exp(-1)', math.exp(-1), 1/math.e)
67
testit('exp(0)', math.exp(0), 1)
@@ -129,6 +134,11 @@ def testmodf(name, (v1, v2), (e1, e2)):
129
134
testit('pow(2,1)', math.pow(2,1), 2)
130
135
testit('pow(2,-1)', math.pow(2,-1), 0.5)
131
136
137
+print 'radians'
138
+testit('radians(180)', math.radians(180), math.pi)
139
+testit('radians(90)', math.radians(90), math.pi/2)
140
+testit('radians(-45)', math.radians(-45), -math.pi/4)
141
132
142
print 'sin'
133
143
testit('sin(0)', math.sin(0), 0)
144
testit('sin(pi/2)', math.sin(math.pi/2), 1)
0 commit comments