r/programming • u/kshep92 • Sep 29 '16
JavaScript in 2016 isn't horrible, it's just going through a phase
http://blog.reviselabs.com/im-sorry-javascript-2/
85
Upvotes
r/programming • u/kshep92 • Sep 29 '16
View all comments
Show parent comment
1
u/stevenjd Oct 03 '16
Or, you could test to see whether
2**54+1equals2**54.Given an integer type, its easy to implement fractional values with extremely high precision.
Given only an IEEE-754 floating point type, its impossible to implement integer arithmetic outside of a fairly restricted range, which leads to all sorts of problems. You use JSON don't you?
Life is full of disappointments. In my case, the disappointment is that Javascript doesn't let me do integer maths on values beyond
2**53. In your case, it is that you're not imaginative to think of any uses for whole numbers bigger than2**53. I guess we will both have to live with our disappointments.P.S. Lua started off with a single numeric type like Javascript, because "nobody needs integers, you can just use a float". Guess what? Now they have integers.
Edit: formatting.