lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
not all numbers are treated the same way
From
: Pantelis Kavallieratos <kavallieratos@
...
>
Date
: Thu, 15 Jul 2010 00:59:25 +0300
one would expect that b=1-(1-a) leads to b=a
that is not always the case if a is a rational number less than 1
if a is one of the following 1/3, 1/5, 1/6, 2/6, 1/7, 3/7, 1/9, 3/9, 1/10, 2/10, 3/10, 1/11 ...
b=1-(1-a)
print(a==b)
returns false!
Follow-Ups
:
Re: not all numbers are treated the same way
,
Peter Cawley
Re: not all numbers are treated the same way
,
Charles Nicholson
Re: not all numbers are treated the same way
,
David Kastrup
Prev by Date:
Re: Multiple assignments to the same variable
Next by Date:
Re: not all numbers are treated the same way
Previous by thread:
Re: Control over Lua execution
Next by thread:
Re: not all numbers are treated the same way
Index(es):
Date
Thread