cognitect / transit-format

A data interchange format.
1.88k stars 36 forks source link

Please clarify the breakpoint for ints at 53 or 63 bits #14

Closed jlouis closed 10 years ago

jlouis commented 10 years ago

It seems the python implementation uses 63 bits, whereas the Java implementation uses 53 bits.

Which implementation is right?

My guess is Java and the spec. Using 53 bits is the cutoff point for precise representation inside a typical IEEE 754 double :)

swannodette commented 10 years ago

@jlouis the breakpoint is 53 bits to account for JavaScript. If Python is 63 bits that's a bug - but we have a pretty large test suite to verify the behavior around this. Where are you seeing this problem?

jlouis commented 10 years ago

I thought as much, issue filed against the python repo as cognitect/transit-python#7

What is more of a problem is that it seems this has avoided the scrutiny of test cases. In particular, the "interesting_ints" test case, which does produce numbers ultimately getting written in the string "~i..." format.

benkamphaus commented 10 years ago

Thanks for bringing this up. This issue has now been fixed in the python kit.

jlouis commented 10 years ago

Since this has been fixed in Python, and the spec is right, we can close this issue.