>>> 10000000000000000 === 10000000000000001 true >>> 10000000000000000+1 10000000000000000
Here's the article: http://blog.greweb.fr/2013/01/be-careful-with-js-numbers/
Thank you Senzon for sharing that article with us
Interesting! I have to say, I wasn't aware of that either...
I guess on the one hand it "reduces complexity" in that it saves on multiple types for JS to store and manipulate/carry out any operations on numbers. If they're ALL in floating point, it saves casting and conversion - perhaps at the expense of memory and speed though.
However, it looks like they wrap it up to the Nth degree to hide that fact. JS must waste a lot of time just determining types? For any given variable JS must have to inspect the variable contents first - which seems a bit backwards and more intensive than just having typed variable in the first place, negating any benefit of a single numeric type?
Meh, maybe I am over analysing it CPU Architecture exam in two days time, I'll blame that!