[sage-devel] Re: difference between repr and print

2009-03-22 Thread Henryk Trappmann
Oh, thank you. I wasnt aware of it. On Mar 22, 11:11 am, Mike Hansen wrote: > On Mar 22, 3:03 am, Henryk Trappmann wrote: > > > sage: a = float(1-2**(-50)) > > sage: repr(a) > > '0.99911' > > sage: print(a) > > 1.0 > > > Is that intended? > > This is Python's default behavior.  repr

[sage-devel] Re: difference between repr and print

2009-03-22 Thread Mike Hansen
On Mar 22, 3:03 am, Henryk Trappmann wrote: > sage: a = float(1-2**(-50)) > sage: repr(a) > '0.99911' > 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: