[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Lua multiplication problem
- From: Tom Reahard <tom@...>
- Date: Fri, 25 Nov 2005 01:01:24 -0700
I am experiencing some strange behavior with numbers where the results
of a multiplication should equal a given number but Lua does not
recognize the equality.
Here are some examples:
if ( 20425 * .053 ) == 1082.525 then print ("equal") else print ("not
if rawequal( 20425 * .053, 1082.525 ) then print ("equal") else print
Both result in "not equal". Lua interprets the multiplication as less
than the correct number.
if ( 20425 * .053 ) < 1082.525 then print ("less than") else print ("not
less than") end
I am using Lua 5.02 on Windows from the LuaBinaries (Release 2). I
quickly downloaded and tested Lua 4.0 and it has the same issue.
Thanks for any help on this.