The Numbers Magic (Amsterdam Node Meetup Presentation)

Post on 19-Jul-2015

104 views 2 download

Tags:

Transcript of The Numbers Magic (Amsterdam Node Meetup Presentation)

Numbersthe

Magic

@lucamaraschi

Once upon the time…

Numbers are not perfect

in JS“primitive value corresponding to a double-precision 64-bit binary format IEEE 754 value”

64bits

Sign

Sign

ExponentMantissa

+

+

Sign

exponent11bit

s

Sign

exponentposition of the floating point!

Sign

mantissa52bit

s

1hidden

bit

+

so 0.1 is not really 0.1

Fractionsbuild of the inverse power of 2

only 52 bits of mantissaand

fix size of 64bitsand

53 bits of exponentcan only represent every second integer

Future

DEC64Coefficient

* 10^Exponent=

by Douglas Crockford

DEC64Coefficient Exponent

8 bits56 bits

Physicians accept the uncertainty of the

measurementWalter Lewin

we are hiring. icemobile.com/jobs

icemobile.com/blog /company/icemobile

IceMobileAmsterdam @icemobile@icemobile

Adding emotion to transactional loyalty