Comparing floating-point numbers
#6
something like this:

Code:
if math.abs( var1 - var2 ) < 1e-3 then
   -- equal
else
    -- not equal
end
Reply
Thanks given by:


Messages In This Thread
Comparing floating-point numbers - by DrMasik - 12-20-2015, 10:08 AM
RE: Comparing floating-point numbers - by DrMasik - 12-20-2015, 09:48 PM
RE: Comparing floating-point numbers - by jan64 - 12-20-2015, 10:13 PM
RE: Comparing floating-point numbers - by DrMasik - 12-20-2015, 10:48 PM
RE: Comparing floating-point numbers - by jan64 - 12-21-2015, 07:11 AM



Users browsing this thread: 1 Guest(s)