5 ms·
Decimal types made it into the c/cpp standards this year, hopefully this will mean that more than Power and Japanese Sparc chips may have radix 10 support soon.
by nyrikki 3y ago
Decimal types made it into the c/cpp standards this year, hopefully this will mean that more than Power and Japanese Sparc chips may have radix 10 support soon.
One of the nice things is that it will be faster than the arbitrary precision libs and the sum of any two numbers will be representable.
But arbitrary precision libraries are incredibly slow. Compared to radix 2 floats.
Note that it won't ever be the default, as the standard imprecise but deterministic floats are an important feature for floats.
Even with a piece of paper of arbitrary length, the real numbers are uncomputable almost everywhere and even if they weren't you still need to keep things in the countable infinity sets to be semi-decidable.
We will see if decimal types, which require 4 bits for the radix become more common now that c/cpp support them but that may be optimistic.
- lsllc 3y ago> Decimal types made it into the c/cpp standards this year Are you referring to TR 24732 (at least for C)? Is that going to be in C23?
- nyrikki 3y agoProbably safest to point you to here for C23 but TS 18661-2:2015 TR 24732 was withdrawn. https://en.cppreference.com/w/c/23 https://en.cppreference.com/w/c/23 Note the link to paper n2341 https://open-std.org/JTC1/SC22/WG14/www/docs/n2341.pdf https://open-std.org/JTC1/SC22/WG14/www/docs/n2341.pdf C++ is going to be a library for now I think, but haven't looked recently.
- lsllc 3y agoThank you :-)