The specific reason in your case is that the real number 0.94 cannot be represented exactly in a double precision floating point. When you type 0.94
, the actual number stored is 0.939999999999999946709294817992486059665679931640625
.
More Related Contents:
- Floating point inaccuracy examples
- How to correctly and standardly compare floats?
- Why not use Double or Float to represent currency?
- How dangerous is it to compare floating point values?
- Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?
- Is floating point arbitrary precision available?
- Dealing with float precision in Javascript [duplicate]
- How is floating point stored? When does it matter?
- Why is NaN not equal to NaN? [duplicate]
- strange output in comparison of float with float literal
- How to compare double numbers?
- Dealing with accuracy problems in floating-point numbers
- negative zero in python
- floating point issue in R? [duplicate]
- Floating point equality and tolerances
- python floating number [duplicate]
- Floating point less-than-equal comparisons after addition and substraction
- Floating Point Limitations [duplicate]
- Extended (80-bit) double floating point in x87, not SSE2 – we don’t miss it?
- Truncate float numbers with PHP
- Why does IEEE 754 reserve so many NaN values?
- Does JavaScript have double floating point number precision?
- Why do these two float64s have different values?
- Why does the floating-point value of 4*0.1 look nice in Python 3 but 3*0.1 doesn’t?
- What’s the relative speed of floating point add vs. floating point multiply
- Can I use the AVX FMA units to do bit-exact 52 bit integer multiplications?
- mean from pandas and numpy differ
- What uses do floating point NaN payloads have?
- Having parameter (constant) variable with NaN value in Fortran
- Maximum number of decimal digits that can affect a double