On Sat, Nov 14, 2009 at 9:17 AM, pong <[email protected]> wrote:
>
> I apologize in advance that this is essentially a question about
> python instead of sage.
>
> When I type 0.6**2 in python, it returns
> 0.35999999999999999
>
> When I do the same in SAGE
> 0.360000000000000
>
> It gives the correct answer. Why so? And can I make python gives the
> "correct" answer as well?

I highly recommend that you read

     http://docs.python.org/tutorial/floatingpoint.html

to understand why Python does what it does.

William

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to