I was doing the questions in http://javascript-puzzlers.herokuapp.com/. For the 8th problem,
What is the result of this expression? (or multiple ones)
var two = 0.2
var one = 0.1
var eight = 0.8
var six = 0.6
[two - one == one, eight - six == two]
The answer is [true, false]. After reading the explanation that JavaScript does not have precision math even though sometimes it works correctly, I feel the answer should be random. Not a standard answer.
Can anyone help and give more detailed explanation about the answer? Thx in advance!
Update
This explains Why 0.1 + 0.1 == 0.2?