Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.030 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; '64-bit': 0.07; 'float': 0.07; 'bits': 0.09; 'subject:set': 0.09; 'subset': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'exponent.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'two.': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'adds': 0.24; 'cc:2**0': 0.24; 'van': 0.27; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; '(unless': 0.31; 'subject:numbers': 0.31; 'subject:size': 0.31; 'another': 0.32; 'subject:the': 0.34; 'subject: (': 0.35; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'tight': 0.36; 'represent': 0.38; 'pm,': 0.38; 'enough': 0.39; 'even': 0.60; 'continued': 0.60; 'real': 0.63; 'more': 0.64; 'between': 0.67; 'mar': 0.68; 'power': 0.76; 'albert': 0.91; 'numbers:': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=X3ddmmt68ynWnJdPZx9DG3jMSO/EO87+jgpAOsEazjE=; b=zL6N2VWMKuZXVbUdVq4yAsgRrSyroWX62nBq7Lh6AhmG+iNqwavdUFdg2lCTp0qYX4 HMi8dT3GqKnJmtHvSu8J/yQy0kUaqevCNp0W0G0WsgnU2+62T/Dqp29ufmJJc7aPhGu5 fuXdhR1at6/g8M4yDkHvx5veVSCL5ogjVPnTw050grUvqMVn2031CQpwi/wXdgT+AnjB 7Xtw1b48czK9rXiXjalVt0X87MqV096uSyXs8tkDRxoBaZJQW6AxSjGjTvE0WNaVmyd3 h98CN1D5PBZsRfloUahqasNFV6iPFtXObVm2YwSFImjvK8UMAOrar+k7lS4Bff/h6Ngy oPXg== MIME-Version: 1.0 X-Received: by 10.68.200.74 with SMTP id jq10mr645091pbc.169.1393902122003; Mon, 03 Mar 2014 19:02:02 -0800 (PST) In-Reply-To: <53153e66$0$24931$e4fe514c@dreader36.news.xs4all.nl> References: <8e4c1ab1-e65d-483f-ad9d-6933ae2052c3@googlegroups.com> <85r478bv99.fsf_-_@benfinney.id.au> <53153e66$0$24931$e4fe514c@dreader36.news.xs4all.nl> Date: Tue, 4 Mar 2014 14:02:01 +1100 Subject: Re: Working with the set of real numbers (was: Finding size of Variable) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393902132 news.xs4all.nl 2888 [2001:888:2000:d::a6]:50286 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67631 On Tue, Mar 4, 2014 at 1:45 PM, Albert van der Horst wrote: >>No, the Python built-in float type works with a subset of real numbers: > > To be more precise: a subset of the rational numbers, those with a denominator > that is a power of two. And no more than N bits (53 in a 64-bit float) in the numerator, and the denominator between the limits of the exponent. (Unless it's subnormal. That adds another set of small numbers.) It's a pretty tight set of restrictions, and yet good enough for so many purposes. But it's a far cry from "all real numbers". Even allowing for continued fractions adds only some more; I don't think you can represent surds that way. ChrisA