I read this at W3Schools :
All numbers in JavaScript are stored as 64-bit (8-byte) base 10, floating point numbers.
That sounds pretty weird. Now this is either wrong, or there must be a good reason not to use base 2, like the IEEE standard.
I tried to find a real JavaScript definition, but I could not find it. In the V8 or WebKit documentation, the two versions of JavaScript that I could find on Wikipedia that were most familiar to me, I could find how they saved the JavaScript number type.
So, does JavaScript use base 10? If so, why? The only reason I could come up with is that maybe using base 10 has the advantage when you want to be able to store integers as well as floating point numbers exactly, but I don't know how using base 10 will to have an advantage for this myself.
source
share