According to IEEE 754-2008 there are
There are three binary floating-point basic formats (which can be encoded using 32, 64 or 128 bits) and two decimal f
C++ does not specify that float
s must be 32-bit or that double
s must be 64-bit. It does not even require there to be 8 bits in a byte (though there do have to be at least 8).
[C++11: 3.9.1/8]:
There are three floating point types:float
,double
, andlong double
. The typedouble
provides at least as much precision asfloat
, and the typelong double
provides at least as much precision asdouble
. The set of values of the typefloat
is a subset of the set of values of the typedouble
; the set of values of the typedouble
is a subset of the set of values of the typelong double
. The value representation of floating-point types is implementation-defined. Integral and floating types are collectively called arithmetic types. Specializations of the standard templatestd::numeric_limits
(18.3) shall specify the maximum and minimum values of each arithmetic type for an implementation.
See the documentation for your toolchain and platform to see what its type sizes are. It might support long double
, which in turn might be what you want.