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

There's nothing wrong with relying on floating point to be "exact". That is, correctly rounded. As exact as it can be.



Yes, but if you care about reading in exact numbers from text, floating point is usually not the right tool for the job.


It's perfectly fine as long as you know the rules. Virtually all JavaScript code is heavily reliant on exact answers from floating point (since floating point is all you have) and it continues to work. :)


They are heavily reliant on exact answers for the subset of small integers. But not that edges cases are handled 100% correct. Denormals, trigs of very large number, parsing of numbers with lots of significant figures.

It could lead to degraded precision for mathematical calculations with lots of steps, but that should be a problem for only a small minority of js code.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: