Hacker News new | past | comments | ask | show | jobs | submit | munrocket's comments login

interesting, thanks!


Probably it's need some time for load or reload would help?


I thought it was pretty clear that examples in the list are links :D


I missed them and came here to ask for links lol.



How many FLOP do you need to add two rationals? We don't have int type in javascript, only bigInt but it not supported in some browsers and probably not fast enough.

UPD: I added Fraction.js to benchmark https://munrocket.github.io/double.js/docs/benchmark.html but it slower and overflows for some reason, .round(31) not helps.


Adding two rationals boils down to adding 2x two integers. Integer arithmetic is in general less complex then floating point arithmetic. But of course that's not true if your hardware supports single instruction double floating point arithmetic (which any relevant 64bit architecture does).


The problems begins when calculations is long and int64/int32 not enough to store full fraction precision. Lol seems that I find a bug in Fraction.js in rounding https://runkit.com/munrocket/fraction-js-test, but it used in popular Math.js library.


Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: