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

It is hard to design. There should be some sort of precision and rounding mode control throughout calculation, meaning there should be some sort of implicit state or those controls should be sprayed into every operation. The latter is explicit but tedious [1]. The former will still surprise people from time to time. IEEE 754 binary number is sort of working well in this aspect.

[1] See QuickJS's BigDecimal extension for example: https://bellard.org/quickjs/jsbignum.html#Properties-of-the-...



that's eactly why it needs to be in standard library- so people dont make mistakes reinventing the wheel


Only if you have a proven design. I don't think we have any satisfactory design at all.


What's wrong with https://en.m.wikipedia.org/wiki/Decimal64_floating-point_for...

Or with C# 128 bit implementation of decimal?

Is there no good implementation anywhere?




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

Search: