jayendra13 / simpleubjson

Automatically exported from code.google.com/p/simpleubjson
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Patch for /simpleubjson/encoder.py #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Otherwise many negative numbers (for example -100) that can be encoded as 
float/double will be encoded as huge.

Original issue reported on code.google.com by efimovov on 16 Oct 2011 at 3:29

Attachments:

GoogleCodeExporter commented 8 years ago
And also limits looks strange. Minimal positive float value is 0x00800000 
(00000000 10000000 00000000 00000000) ~= 1.18E-38 and not equal 1/1.18E38.

Original comment by efimovov on 16 Oct 2011 at 3:36

GoogleCodeExporter commented 8 years ago

Original comment by kxepal on 18 Oct 2011 at 10:24

GoogleCodeExporter commented 8 years ago
I don't know why I setup those boundary values, but you are right - they are 
incorrect.

Fixed in rbce4aecd43e6.

Also, there was problem with encoding 1.80e308 value - it makes INF value at 
least with 32-bit Python version. In UBJSON specification I didn't found any 
remarks about infinity values, so I'll make request for official comments.

Original comment by kxepal on 18 Oct 2011 at 1:14