On Mon, Jun 11, 2012 at 6:45 PM, Kwankyu <[email protected]> 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.
> :-)
Use Python's (hence Sage's) decimal module, which is designed to do
arithmetic with decimal numbers with human (rather than alien)
semantics:
sage: from decimal import Decimal
sage: Decimal('10.44') - Decimal('10.30') == Decimal('0.14')
True
-- William
>
>
> Kwankyu
>
> --
> 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
--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
--
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