On Mar 22, 3:03 am, Henryk Trappmann <bo198...@googlemail.com> wrote:
> sage: a = float(1-2**(-50))
> sage: repr(a)
> '0.99999999999999911'
> sage: print(a)
> 1.0
>
> Is that intended?

This is Python's default behavior.  repr uses 17 digits of precision
while str only uses 12.  It is covered in the Python tutorial:
http://docs.python.org/tutorial/floatingpoint.html

--Mike
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to