round in 2.6 and 2.7

Martin v. Loewis martin at v.loewis.de
Tue Dec 28 16:47:06 EST 2010


>> "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 would be 9.9
> exactly.  But since 9.9 isn't exactly representable as a Python float,
> we necessarily get an approximation.  The language above is intended
> to convey that it's the 'correctly rounded' approximation

I see. Shouldn't it say then "The round() function
gives/produces/returns correctly rounded results now", instead of saying
that
the round function *is* correctly rounded? ISTM that the round
function cannot be rounded (correctly or not):

py> round(round)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: a float is required

But then, I'm not a native speaker (of English).

Regards,
Martin



More information about the Python-list mailing list