lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> What is the best way, for test float equality?
> 
> I consider to use tostring function:
> print (300 * 0.07, 21, tostring (300 * 0.07) == tostring (21)),

For this kind of numbers I think this is the best option, especially
since it's in a unit test. But you make sure you know why tests like
300 * 0.07 == 21 give false. Otherwise, tell us more about the problem
you're trying to solve.