On 6/11/12 6:45 PM, Kwankyu wrote:
Hi all,
I am puzzled.
sage: 10.44-10.30==0.14
False
How should I compare them to get True? Suddenly Sage feels very alien to
me. :-)
You never compare decimal numbers exactly on a computer. Because of
finite precision, there almost always will be corner cases that will
catch you. Instead, do something like:
10.44-10.30-0.14 < 1e-10
or something like that.
Thanks,
Jason
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org