aproximate a number

billiejoex billiejoex at fastwebnet.it
Tue Aug 30 17:47:35 CEST 2005


I wanted the round up the number (5.0 = 5.0, not 6.0.). The ceil funciotn is 
the right one for me.
Thanks to all.


>> Grant Edwards wrote:
>>> On 2005-08-30, Devan L <devlai at gmail.com> wrote:
>>> >
>>> > RoundToInt(2.0) will give you 3.
>>>
>>> That's what the OP said he wanted.  The next bigger integer
>>> after 2.0 is 3.
>>
>> It's not really clear whether he wanted it to round up or to go to the
>> next biggest integer because he says he has bad english. I can't think
>> of a particular use of returning the next bigger integer.
>
> You're probably right.  I suspect what he really wants is
>
> i = int(math.ceil(x))
>
> -- 
> Grant Edwards                   grante             Yow!  Is it FUN to be
>                                  at               a MIDGET?
>                               visi.com 





More information about the Python-list mailing list