[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why is there no 'math.round'?
- From: "Mike Crowe" <drmikecrowe@...>
- Date: Wed, 23 Apr 2008 10:43:02 -0400
What's the specific request that we are trying to define? math.round(value, precision) for non-integer rounding?
I'm confused about what is being requested. I agree with the earlier observation that floor/ceil give us everything we need:
> a = 12.345678
> print(math.floor(a+0.5))
12
> print(math.floor(a*10+0.5)/10)
12.3
> print(math.floor(a*100+0.5)/100)
12.35
Am I missing something very obscure?