Re: round in 2.6 and 2.7

2010-12-29 Thread Mark Dickinson
On Dec 28, 9:47 pm, "Martin v. Loewis" wrote: > >> "Float-to-string and string-to-float conversions are correctly rounded. > >> The round() function is also now correctly rounded." > > >> Not sure that this is correct English; I think it means that the > >> round() function is now correct. > > > W

Re: round in 2.6 and 2.7

2010-12-28 Thread Terry Reedy
On 12/28/2010 4:47 PM, Martin v. Loewis wrote: "Float-to-string and string-to-float conversions are correctly rounded. The round() function is also now correctly rounded." The second line was written to be parallel to the first, but the first is slightly ambiguous in that 'conversions' can ref

Re: round in 2.6 and 2.7

2010-12-28 Thread Martin v. Loewis
>> "Float-to-string and string-to-float conversions are correctly rounded. >> The round() function is also now correctly rounded." >> >> Not sure that this is correct English; I think it means that the >> round() function is now correct. > > Well, the correct result of the example the OP gave woul

Re: round in 2.6 and 2.7

2010-12-27 Thread Mark Dickinson
On Dec 23, 6:57 pm, Hrvoje Niksic wrote: > I stumbled upon this.  Python 2.6: > > >>> round(9.95, 1) > > 10.0 > > So it seems that Python is going out of its way to intuitively round > 9.95, while the repr retains the unnecessary digits. No, Python's not doing anything clever here. Python 2.6 us

Re: round in 2.6 and 2.7

2010-12-24 Thread Hrvoje Niksic
"Martin v. Loewis" writes: >> Type "help", "copyright", "credits" or "license" for more information. > 9.95 >> 9.9493 > "%.16g" % 9.95 >> '9.949' > round(9.95, 1) >> 10.0 >> >> So it seems that Python is going out of its way to intuitively round >> 9.95, while

Re: round in 2.6 and 2.7

2010-12-23 Thread Stefan Sonnenberg-Carstens
Am 23.12.2010 19:57, schrieb Hrvoje Niksic: I stumbled upon this. Python 2.6: Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. 9.95 9.9493 "%.16g" % 9.95 '9.949' round(9.95,

Re: round in 2.6 and 2.7

2010-12-23 Thread Martin v. Loewis
> Type "help", "copyright", "credits" or "license" for more information. 9.95 > 9.9493 "%.16g" % 9.95 > '9.949' round(9.95, 1) > 10.0 > > So it seems that Python is going out of its way to intuitively round > 9.95, while the repr retains the unnecessary digit

Re: round in 2.6 and 2.7

2010-12-23 Thread macm
On Dec 23, 4:57 pm, Hrvoje Niksic wrote: > I stumbled upon this.  Python 2.6: > > Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) > [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information.>>> 9.95 > 9.9493 > >>> "%.16g" % 9.95 > '9.949