Given the following:
.1 + .2 === .3 // false
1 * .3 === .3 // true
...the former does not result in 0.3
because one or more of the operands cannot be exactly represented in IEEE 754 double-precision floating point, so the result is almost but not quite 0.3
.
Why does the latter return true
. Is it because 0.3
happens to be exactly representable in IEEE 754 double-precision floating point?