is there a floating point data type in Visual C++ that has enough precision in the mantissa to hold an INT64?
Example it should be possible to do the following:
__int64 from = 0xFFFFFFFFFFFFFFFF;
mightyFP intermediate;
__int64 to;
intermediate = from;
to = intermediate;
assert(from == to);
where mightyFP is the unknown type that I search.
regards, Tobias
The most commonly used floating point standard is the IEEE standard. According to this standard, floating point numbers are represented with 32 bits (single precision) or 64 bits (double precision).
The FLOAT data type stores double-precision floating-point numbers with up to 17 significant digits. FLOAT corresponds to IEEE 4-byte floating-point, and to the double data type in C. The range of values for the FLOAT data type is the same as the range of the C double data type on your computer.
There are three different floating point data types: float, double, and long double.
In addition, there is a floating-point zero; depending on the implementation, there may also be a ``minus zero. '' If there is no minus zero, then 0.0 and -0.0 are both interpreted as simply a floating-point zero.
Short answer, no. long double
and double
have the same representation in visual studio. For x86 the size of both is 64 bits, which isn't enough to hold the full range of a 64-bit integer.
You need GMP
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