Pardon my ignorance, data conversion

Justin Sheehy dworkin at ccs.neu.edu
Wed Jan 19 23:10:42 EST 2000


"Michael P. Reilly" <arcege at shore.net> writes:

> Floor does funny things to negative numbers.

> >>> int(floor(-3.4))
> -4
> >>> int(floor(-4.5))
> -5

In both cases, int(floor(x)) is giving you the greatest integer that
is not greater than x.  How is this funny?

-Justin

 




More information about the Python-list mailing list