Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Jsonize int64 surprise
Re: Jsonize int64 surprise [message #38868 is a reply to message #38867] Thu, 24 January 2013 20:30 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Thu, 24 January 2013 14:21

I may be wrong. But my point is that JSON is used mostly in Web development. In our case this means:
Quote:

server[U++] <-> client[javascript]

And javascript natively supports integers up to 64-bit length (actually 53-bit, see below). So should we in U++.
This article
http://cdivilly.wordpress.com/2012/04/11/json-javascript-lar ge-64-bit-integers/
corrects that Javascript actually support integers up to 2^53. So if we really want to be close to standards here, we should check not INT_MAX, but 2^53 for stringification.



Well, but that actually is exactly what I propose (I just got 56 wrong, it is indeed 53).

Quote:


But I'd suggest eliminating ANY surprises at all. We have number - we represent as number. But one may disagree with it.


Well, there seems to be no 100% correct solution, but I think that lost precision would not be a good thing as well...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is FrameLess() working under Linux ?
Next Topic: Request: completion 64 bit support in Draw and Stream
Goto Forum:
  


Current Time: Fri Mar 29 05:54:07 CET 2024

Total time taken to generate the page: 0.01251 seconds