Convert '165.0' to int

Chris Angelico rosuav at gmail.com
Fri Jul 22 16:06:32 EDT 2011


On Sat, Jul 23, 2011 at 5:32 AM, rantingrick <rantingrick at gmail.com> wrote:
> That's nine-quadrillion people! Only for galactic measurements or
> microscopic reasons would you need such large numbers.
>

Never decide that "nobody would need numbers bigger than X". Someone
will. One common thing to do with big numbers is to use the pieces
separately; although I would never recommend floating point for
encoded numbers like that. But I quite happily treat BIND serial
numbers as straightforward integers, and they're usually something
like 2011072203 for the 3rd change on the 22nd of July 2011. That's a
fairly small example (in fact, BIND requires that serial numbers fit
inside a 32-bit integer, IIRC), but there are plenty of other examples
of numbers that get big fast because of that sort of thing.

ChrisA



More information about the Python-list mailing list