As floating point operations are implemented at a low level by CPUs, the C++ standard does not mandate a size for either a float
, double
or long double
. All it says is that the order I specified them is in equal or increasing order of precision.
Your best bet is to use static_assert
, sizeof
, typedef
and #define
carefully in order to define cross platform floating point types.