Is there any way (library, ecc.) to replace the
double data types with other base-10 ones to avoid the floating point error?
> base-10 ones to avoid the floating point error?
An IEEE 754 base-10 floating point number is finite and inexact.
While 1.0/5.0 is representable exactly, 1.0/7.0 is not.
Last edited on
You can always just write your own Rational class.
@Cubbi How can I use those types? If I write
std::decimal::decimal128 a; I get an error because for it
std is the C++ Standard Library, not the GCC
std. What can I do? (I have LLVM GCC 4.2)
Does it make any difference the fact that I have the LLVM GCC? Or its 4.6 version will be good?