3 ms·
There are numbers that are safe to compare against. Storing 1.0 (or 0.0 or 0.25 or any small integer), and then later comparing for equality to check "Did I as
by yongjik 10y ago
There are numbers that are safe to compare against. Storing 1.0 (or 0.0 or 0.25 or any small integer), and then later comparing for equality to check "Did I assign this value before?" is completely fine.
Of course, it's not fine to ask "Does the result of this computation equal this value?", but everyone knows that.
- jobigoud 10y ago> Of course, it's not fine to ask "Does the result of this computation equal this value?", but everyone knows that. How about "Does the result of this computation equal the result of this exact same computation?"? That's the issue here.