Hacker News new | past | comments | ask | show | jobs | submit login

    2**100+1-2**100
Equals 0?



That's nice test but to fair their tagline says high precision not arbitrary precision.


It seems it uses approximate floating point arithmetics, with 30 digit precision.


A confusing thing is that the program seems to be using the purescript-quantity library which uses the purescript-decimals library which is arbitrary precision numbers, if I followed the dependencies correctly.

The readme also advertises it can deal with 10^(10^10), which it can (doubles can't deal with this, so it's definitely not just using Javascript doubles). The part which prints out numbers rounds to 6 places, but I don't see any place which rounds intermediate results.

Edit: Found where 30 digits comes in. https://github.com/sharkdp/purescript-decimals/blob/ad719fc7...


Correct. "2^99 + 1 - 2^99" still works because 2^99 < 10^30




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: