Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'plenty': 0.04; 'encoded': 0.05; 'happily': 0.07; '32-bit': 0.09; 'bind': 0.09; 'integer,': 0.09; 'examples': 0.12; 'am,': 0.13; 'wrote:': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'rantingrick': 0.16; 'received:209.85.213.174': 0.16; 'received :mail-yx0-f174.google.com': 0.16; 'subject:Convert': 0.16; "subject:' ": 0.16; 'header:In-Reply-To:1': 0.22; 'pieces': 0.23; '(in': 0.26; 'sort': 0.28; 'sat,': 0.28; 'message- id:@mail.gmail.com': 0.28; 'example': 0.30; 'fairly': 0.30; 'usually': 0.33; 'to:addr:python-list': 0.34; 'decide': 0.34; 'there': 0.34; 'reasons': 0.34; 'someone': 0.34; 'quite': 0.34; 'numbers.': 0.35; 'bigger': 0.37; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'something': 0.38; 'common': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'july': 0.64; 'serial': 0.71; '22nd': 0.84; '2011.': 0.86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=mZfyHX+dWbTbzp2drHoqPaDxbmkC7le58Bu6+aMfZ7Q=; b=LEyAa5dD17JcohAxkOrBi0GFX5WlrY5jZNYIot5hOx4DIMZAVW19Cu5VA3YLc4YvMl NlDVYmypiMcpJ7YJwGCvEQw5kKoJzaLA7J6lv1Dxmz/0ajj0/jN8oihj+ew3WpOImYXb cyKG1CcJ5YSefHTQS3cAS2WZwLHxvHFQ0T+W8= MIME-Version: 1.0 In-Reply-To: References: <4e281f97$0$16404$426a74cc@news.free.fr> <87vcuusd0j.fsf@xemacs.org> Date: Sat, 23 Jul 2011 06:06:32 +1000 Subject: Re: Convert '165.0' to int From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311365195 news.xs4all.nl 23943 [2001:888:2000:d::a6]:42271 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10150 On Sat, Jul 23, 2011 at 5:32 AM, rantingrick 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