Skip to content

TST: test_encodeDoubleTinyExponential breaking on 32-bit #4306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jreback opened this issue Jul 20, 2013 · 1 comment · Fixed by #4307
Closed

TST: test_encodeDoubleTinyExponential breaking on 32-bit #4306

jreback opened this issue Jul 20, 2013 · 1 comment · Fixed by #4307
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Jul 20, 2013

related #4299
cc @Komnomnomnom

weird that this doesn't break on travis (but did on my vagrant machine), and on debian testing....

any thoughts?

> /home/vagrant/pandas_master/pandas/io/tests/test_json/test_ujson.py(109)test_encodeDoubleTinyExponential()
-> self.assertEqual(num, ujson.decode(ujson.encode(num)))
(Pdb) l
104             num = 1e-100
105             self.assertEqual(num, ujson.decode(ujson.encode(num)))
106             num = -1e-45
107             self.assertEqual(num, ujson.decode(ujson.encode(num)))
108             num = -1e-145
109  ->         self.assertEqual(num, ujson.decode(ujson.encode(num)))
110  
111         def test_encodeDictWithUnicodeKeys(self):
112             input = { u"key1": u"value1", u"key1": u"value1", u"key1": u"value1", u"key1": u"value1", u"key1": u"value1", u"key1": u"value1" }
113             output = ujson.encode(input)
114  
(Pdb) p num
-1e-145
(Pdb) ujson.decode(ujson.encode(num))
-1.0000000000000001e-145
@jreback
Copy link
Contributor Author

jreback commented Jul 20, 2013

This is true...maybe just change the assertions to be allclose? (at least on the really small ones)

Pdb) np.allclose(num, ujson.decode(ujson.encode(num)))
True
(Pdb) x = ujson.decode(ujson.encode(num))
(Pdb) num-x
1.778206999588062e-161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant