+4
Planned

Warning whn doing direct Floating point compare (=, <, > >= <= and <>)

Anonymous 10 years ago updated by Roman 10 years ago 1
It can really lead in weird situations when you something like this

if LDoubleValue = 0.00 then

and should be changed to if SameValue(LDoubleValue, 0.00) then (Super simple case).

when you comparefloating point values are more than less dangerous. And finding them from code is more than less tedious job. Have to find out what the types being compared actually are. (did not check but how this is compiled if LDoubleValue >= LIntValue then... Is the Integer converted Float before compare, but still it might be epsilon away from the even integer value??)

Anyways this can lead to very subtle bugs in your code and very hard to debug and so on. I would predict that getting these out from the legacy code without helping hand is very hard work :)