[Python-Dev] Return type of round, floor, and ceil in 2.6

Daniel Stutzbach daniel at stutzbachenterprises.com
Sun Jan 6 02:22:20 CET 2008


On Jan 4, 2008 1:31 PM, Tim Peters <tim.peters at gmail.com> wrote:
> Curiously, round-to-nearest
> can be unboundedly more expensive to implement in some obscure
> contexts when floats can have very large exponents (as they can in
> Python's "decimal" module -- this is why the proposed decimal standard
> allows operations like "remainder-near" to fail if applied to inputs
> that are "too far apart":

Just to be clear, this problem doesn't come up in round(), right?

Because in round(), you just test the evenness of the last digit
computed.  There is never a need to compute extra digits just to
perform the test.

-- 
Daniel Stutzbach, Ph.D.             President, Stutzbach Enterprises LLC


More information about the Python-Dev mailing list