Status: New
Owner: ----
New issue 247 by
GavinBra...@gmail.com: Trig and equality
http://code.google.com/p/mpmath/issues/detail?id=247
What steps will reproduce the problem?
I'm running this:
import unittest
from mpmath import *
class Test(unittest.TestCase):
def testBasicMaths(self):
assert (sqrt(3) * sin(acos(1/sqrt(3))) * sin(pi/4)).ae('1')
print( sqrt(3) * sin(acos(1/sqrt(3))) * sin(pi/4))
assert sqrt(3) * sin(acos(1/sqrt(3))) * sin(pi/4) == 1.0
if __name__ == "__main__":
#import sys;sys.argv = ['', 'Test.testName']
unittest.main()
What is the expected output? What do you see instead?
I expect this:
Finding files... done.
Importing test modules ... done.
1.0
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
I get this:
Finding files... done.
Importing test modules ... done.
1.0
======================================================================
FAIL: testBasicMaths (Coordinates.Test1.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
File "H:\git\StarClash\Space Clash - Client\src\Coordinates\Test1.py",
line 14, in testBasicMaths
assert sqrt(3) * sin(acos(1/sqrt(3))) * sin(pi/4) == 1.0
AssertionError
----------------------------------------------------------------------
Ran 1 test in 0.010s
FAILED (failures=1)
For some reason 1.0 even though its very very close to 1, its just not
quite close enough to give not fail the test.
What version of the product are you using? On what operating system?
0.18 on Python 3.3 on Windows 7
Please provide any additional information below.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings