Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Everything you never wanted to know about JavaS...

Bartek Szopka
September 15, 2013

Everything you never wanted to know about JavaScript numbers

All the ECMAScript standard says about Numbers in JavaScript is that they are represented by “the double-precision 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic” and, while understanding the binary representation of JavaScript numbers is not necessary in your day-to-day programming, it’s really worth digging into as it opens up the brave new world of questions you never thought you could ask (why is 0.1 not exactly what it is? how does Infinity look like? is there more than one zero? why the hell it’s called floating point?) and, more importantly, allows us to find answers to them.

Bartek Szopka

September 15, 2013
Tweet

More Decks by Bartek Szopka

Other Decks in Programming

Transcript