Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> ...but we use a slightly worse (but more performant) routine.

If it (dragonbox?) is more performant, why is it also worse?



The fast algorithm is less accurate in the least significant bits. In zX41ZdbW's first link above, there's a code comment that includes the exact count of numbers grouped by how inaccurate the results were.


Presumably it's not as accurate?


Someone needs to make a bumper sticker for developers that says “fast and wrong”. I’d imagine non-programmers would buy more of them for other reasons…


It's only on edge cases that floating point isn't mathematically wrong. And sometimes you don't mind an extra couple ULPs of drift.


fast and wrong? that's not a great bumper sticker to have when you're getting pulled over for speeding.




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

Search: