The number 0.298475
isn’t representable exactly in a double
(since it’s not a fraction whose denominator is a power of two, being 11939/40000), and the actual number that is stored is actually closer to 0.29847 than to 0.29848.
More Related Contents:
- What is the most effective way for float and double comparison?
- How do I print a double value with full precision using cout?
- Random float number generation
- What is the difference between float and double?
- How can I write a power function myself?
- Sin and Cos give unexpected results for well-known angles
- long double vs double
- Difference in floating point arithmetics between x86 and x64
- What is a subnormal floating point number?
- Floating point format for std::ostream
- Change floating point rounding mode
- Emulate “double” using 2 “float”s
- Why did Microsoft abandon long double data type? [closed]
- C++: How to round a double to an int? [duplicate]
- How to detect double precision floating point overflow and underflow?
- Compare two float variables in C++
- A fast method to round a double to a 32-bit int explained
- Set back default floating point print precision in C++
- Floating point Endianness?
- How computer does floating point arithmetic?
- How to correctly and standardly compare floats?
- Convert a float to a string
- Matlab vs C++ Double Precision
- C floating point precision [duplicate]
- Is there a functional difference between “2.00” and “2.00f”?
- Why do sin(45) and cos(45) give different results? [duplicate]
- Printing double without losing precision
- Extra leading zeros when printing float using printf?
- std::stod throws out_of_range error for a string that should be valid
- Does the C++ standard specify anything on the representation of floating point numbers?