Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'one?': 0.05; 'correct.': 0.07; 'float': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:values': 0.16; 'header:User-Agent:1': 0.23; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; '>>>>': 0.31; 'piece': 0.31; 'question:': 0.31; 'skip:s 70': 0.31; 'this.': 0.32; 'info': 0.35; 'minimum': 0.38; '8bit%:86': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'such': 0.63; 'maximum': 0.63; 'received:46': 0.66; 'technically': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Serhiy Storchaka Subject: Re: Floating point minimum and maximum exponent values Date: Tue, 16 Jul 2013 20:21:30 +0300 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 46.211.180.131 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 In-Reply-To: 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373995308 news.xs4all.nl 15942 [2001:888:2000:d::a6]:55329 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50748 16.07.13 15:04, Chris Angelico написав(ла): > Piece of extreme oddity, this. > >>>> help(sys.float_info) > ... lots of other info ... > | max_exp > | DBL_MAX_EXP -- maximum int e such that radix**(e-1) is representable > | > | min_exp > | DBL_MIN_EXP -- minimum int e such that radix**(e-1) is a > normalized float > ... > > So it's technically correct. Followup question: Why is it off by one? sys.float_info.max == sys.float_info.radix**sys.float_info.max_exp - sys.float_info.radix**(sys.float_info.max_exp-sys.float_info.mant_dig)