That's pretty much my question in the title. It seems totally unnatural for anything else to be used.
In researching this I found that there are historical examples of hardware support for base 10, as well as the more modern examples of IBM POWER6 and system z9. Even in these cases, I do not know if FLT_RADIX
would be 10 on any mainstream C compilers.
My particular concern is that I am writing code for an application that will only ever be ran on general purpose computers, and I would like to know if I can statically assert FLT_RADIX==2
without serious concern, like how I am currently statically asserting !(unsigned char)256
.
Annex F, an "optional" part of the C standard that's non-optional for any serious implementation where floating point will be used, requires IEEE single and double precision (binary32 and binary64) for float
and double
, respectively, so FLT_RADIX
should always be 2. On systems where new decimal float stuff is supported, it's a separate extended type; FLT_RADIX==10
is not used for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With