Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The Numbers Magic (Amsterdam Node Meetup Presentation)

424 views

Published on

An Amsterdam Node Meetup presentation by Luca Maraschi on December 16th 2014:

NaN is a Number and (0.1 + 0.2 === 0.3) is not true!JS, and so node.js, are infamous for their number’s management, but are we all right about this? Do we know where this come from? Is it fixable? Can we?

An historical odyssey (excursus) from the origin of floating point calculation till modern languages, which will take us analysing the real business value of IEEE754 and floating point precision, with real case scenarios and their resolution in production.

Published in: Software
  • Be the first to comment

The Numbers Magic (Amsterdam Node Meetup Presentation)

  1. 1. Numbers the Magic
  2. 2. @lucamaraschi
  3. 3. Once upon the time…
  4. 4. Numbers are not perfect
  5. 5. in JS “primitive value corresponding to a double-precision 64-bit binary format IEEE 754 value”
  6. 6. 64bit s
  7. 7. Sign Sign Exponent Mantissa + +
  8. 8. Sign exponent 11bit s
  9. 9. Sign exponent position of the floating point!
  10. 10. Sign mantissa 52bit s 1 hidden bit +
  11. 11. so 0.1 is not really 0.1
  12. 12. Fractions build of the inverse power of 2 only 52 bits of mantissa and fix size of 64bits and
  13. 13. 53 bits of exponent can only represent every second integer
  14. 14. Future
  15. 15. DEC64 Coefficient * 10^Exponent = by Douglas Crockford
  16. 16. DEC64 Coefficient Exponent 8 bits56 bits
  17. 17. Physicians accept the uncertainty of the measurement Walter Lewin
  18. 18. we are hiring. icemobile.com/jobs
  19. 19. icemobile.com/blog /company/icemobile
  20. 20. IceMobileAmsterdam @icemobile@icemobile
  21. 21. Adding emotion to transactional loyalty

×