Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!novso.com!newsfeed.xs4all.nl!newsfeed4a.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.121 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.76; '*S*': 0.00; 'matches': 0.07; 'data:': 0.09; 'cc:addr:python-list': 0.11; 'exponent.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'notation': 0.16; 'sign.': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'written': 0.21; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'closely': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'nature': 0.30; 'especially': 0.30; 'message-id:@mail.gmail.com': 0.30; 'decimal': 0.31; 'ago': 0.33; 'maybe': 0.34; 'subject: (': 0.35; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'dates': 0.36; 'similar': 0.36; 'skip:4 10': 0.37; 'two': 0.37; 'skip:- 10': 0.38; 'that,': 0.38; 'sure': 0.39; 'how': 0.40; 'days': 0.60; 'even': 0.60; 'negative': 0.60; 'ago.': 0.61; "you're": 0.61; 'times': 0.62; 'skip:6 10': 0.63; 'more': 0.64; 'between': 0.67; 'mar': 0.68; 'useful.': 0.68; 'pardon': 0.84; 'studying': 0.84; 'to:none': 0.92; 'imagine': 0.93 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:content-transfer-encoding; bh=aJMVbPk8FVeuSEKXX+AYu+TJ6unzEoAIjiOCKCGKCmg=; b=C4o4jNMQQfP4hnSdRVlmyu9dUdnZzuFUwdEtyovSzVwOJcW/7/ZTq53ztjYF2/Ezzb EJSNeiuBzGU3i9x8WV4JAMiMIhgmJDTLv3r4GIVSH46vWx5si+D5udAXzmAlqlYM1LCP 7fdCdxmp1FI4xXXy7HKxoUgY9lX347Jb7xCnhPS2H32raccRc9Ugsc0V4vn7w9vaMCdg IKulBgF9Y97tOp/4+LIRpg8bXTo+OdCQ4wXVTMq94UFpwGzKSnSqx6bFZDLbhjFcewUq 8tpjg0N1Su3nUUbxnVnHZDrrO7aThzyVv4GdPJHFlmJMu9eVsJLHGRmWhOMfcD1c5YCZ sDRg== MIME-Version: 1.0 X-Received: by 10.66.102.39 with SMTP id fl7mr4915100pab.43.1395843161512; Wed, 26 Mar 2014 07:12:41 -0700 (PDT) In-Reply-To: <5332DDE7.2050202@rece.vub.ac.be> References: <5332DDE7.2050202@rece.vub.ac.be> Date: Thu, 27 Mar 2014 01:12:41 +1100 Subject: Re: YADTR (Yet Another DateTime Rant) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395843169 news.xs4all.nl 2885 [2001:888:2000:d::a6]:45611 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69128 On Thu, Mar 27, 2014 at 1:02 AM, Antoon Pardon wrote: > There is a difference between how people say things and what is useful. > I remember when I was studying logarithms, a negative number like -5.73 > was written down as =CC=856.27 (with a bar only over the six). That notat= ion > had the advantage that the part after the decimal point stayed the same > if you added or subtracted whole numbers. Even if that would change the > sign. That's highly significant with logs, especially when you're working with base 10 logs. >>> math.log10(1234) 3.091315159697223 >>> math.log10(12340) 4.091315159697223 >>> math.log10(123400) 5.091315159697223 >>> math.log10(1234000) 6.091315159697223 >>> math.log10(12.34) 1.0913151596972228 >>> math.log10(1.234) 0.09131515969722287 >>> math.log10(.1234) -0.9086848403027772 >>> math.log10(.01234) -1.9086848403027772 By showing those last ones as 1=CC=85.091... and 2=CC=85.091..., you emphas= ize the floating-point nature of the data: everything after the decimal is the mantissa, and everything before the decimal is the exponent. I can't say for sure as I don't really use that, but I can imagine that there might be something similar with dates and times - it's three days ago at 2:51, not two days and 21:09 ago. Or maybe it's just "print it out in a way that more closely matches the internal representation, to simplify debugging" :) ChrisA