You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How about becoming the first modern language with safe numbers?
mpdecimal could be used as the backend (of course, if static analysis proves smaller boundaries, this should be refined to a much more close-to-bare-metal number type).
Zig (and probably me) plans to implement the compiler_rt decimal routines (https://github.com/ziglang/zig/tree/d6b430b520103fb6691b2c18ae06c2f2a360e806/lib/compiler_rt#readme).
Keep in mind however, that decimals have no hardware acceleration for common hardware (instructions are in x86, but not x86_64).
The main caveat of using those is that they make things unpredictably slow due to the necessary first check + allocation of (for BID how to represent the number sufficiently accurately).
This could also be the reason, why libgcc has The software decimal floating point library supports either DPD (Densely Packed Decimal) or BID (Binary Integer Decimal) encoding as selected at configure time. to make perf at least somewhat more deterministic (you either need general absolute accuracy or only accuracy wrt 2s complement rational numbers).
Sidenode: Zig already has arbitrary precision integers, which have simpler checks and are planned to be exported.
I would assume that the rationals implementation will also be exported, as it complements arbitrary length integers.
How about becoming the first modern language with safe numbers?
mpdecimal could be used as the backend (of course, if static analysis proves smaller boundaries, this should be refined to a much more close-to-bare-metal number type).
Explanation with numerous examples in vlang/v#5180 (comment)
Or in the worst case at least implement vlang/v#9915 .
The text was updated successfully, but these errors were encountered: