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
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
>> "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
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
"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
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,
> 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
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