mjrgit / chrome-rest-client

Automatically exported from code.google.com/p/chrome-rest-client
0 stars 0 forks source link

Rounding for long values #151

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Any dummy service that returns long values such as 1528614066906464256, 
1538955454802034688

What is the expected output? What do you see instead?
Expected output: 1538955454802034688. Actual: 1538955454802034700 
Expected output: 1528614066906464256. Actual: 1528614066906464300

On what operating system, browser and browser version?
WIn 7 x64, Chrome Version 24.0.1312.56 m

Please provide any additional information below.

Original issue reported on code.google.com by hkpa...@gmail.com on 29 Jan 2013 at 4:23

Attachments:

GoogleCodeExporter commented 8 years ago
Chrome extensions / applications are javascript programs. Therefore they are 
limited as a javascript is limited. One of the areas of the limitations is: 
there is only one numeric type in javascript and it is "Number" type which is a 
floating point value.
Maximal numeric value for JS is +/- 9007199254740992. 
However there are some libraries to emulate BigInt (or long) values. However 
they do some operations on strings to achieve this goal. Thus I'm worried about 
performance. I will look into this when I find more time. 

See discussion on 
http://stackoverflow.com/questions/307179/what-is-javascripts-max-int-whats-the-
highest-integer-value-a-number-can-go-t to learn more about this issue.

Because of limitations of some (web) languages (like JS, Dart) I suggest you to 
use String type to represent a long numeric values (like ID). Facebook is 
actually doing this.

Original comment by jarro...@gmail.com on 9 Feb 2013 at 1:27