Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #63065
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| 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; 'float': 0.07; 'below)': 0.09; 'trailing': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; 'random': 0.14; 'digits.': 0.16; 'displayed.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'precision.': 0.16; 'time.time()': 0.16; 'values),': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'subject:need': 0.19; 'cc:addr:python.org': 0.22; 'print': 0.22; '(or': 0.24; 'cc:2**0': 0.24; 'mention': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'returned': 0.30; 'sets': 0.30; 'message- id:@mail.gmail.com': 0.30; 'getting': 0.31; 'decimal': 0.31; 'there.': 0.32; 'subject:the': 0.34; 'subject:from': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'accuracy': 0.36; "he's": 0.36; 'method': 0.36; 'even': 0.60; 'edwards': 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=ycLHaZSkP2L9/pxgLkP5K2rb1Sq0qjDVVieitINxCk8=; b=TiEl6h/lLCBap50Z1+E73d8ALyGLTnZAjRjVaWsuv3nyRBrCUqf76l1zZ6DPIl5vyh XtsRyQFHnBDMz40s6DqN8QEhZQXOAnGSXkwM4dPopdqhYxcy4yahPaQCOFOxP9mej2vR Lvyxut1IbGdwGaBkyaWT9QwdKIO4tfSMNrcBY+DhEe2HBjSynkvjBLiqK3GODE03fUwx TReD9+XpVxOspBrzBc2v4m2DDPaSI0xbtTTpSboGnhsYYc0KlBJIzBN7UwoL3gsEXygF Ikb6O9CKFttHLaLccqQW6WWcmPumOJHCTyon7v3FUyTgwQbgBxyca8bR0tfUVqdjOG8q l3VA== |
| MIME-Version | 1.0 |
| X-Received | by 10.68.98.3 with SMTP id ee3mr11091254pbb.31.1388763671772; Fri, 03 Jan 2014 07:41:11 -0800 (PST) |
| In-Reply-To | <la6l7u$nd0$1@reader1.panix.com> |
| References | <e0e7da6b-5cd9-4e6d-bcca-604bd4bd8d73@googlegroups.com> <mailman.4638.1388085731.18130.python-list@python.org> <59aa73ac-e06e-4c0e-83a4-147ac42cad2e@googlegroups.com> <52bcaeed$0$29995$c3e8da3$5496439d@news.astraweb.com> <la43pq$isp$1@reader1.panix.com> <mailman.4820.1388716773.18130.python-list@python.org> <la6l7u$nd0$1@reader1.panix.com> |
| Date | Sat, 4 Jan 2014 02:41:11 +1100 |
| Subject | Re: need to print seconds from the epoch including the millisecond |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <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 <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4855.1388763675.18130.python-list@python.org> (permalink) |
| Lines | 14 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1388763675 news.xs4all.nl 2874 [2001:888:2000:d::a6]:33826 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:63065 |
Show key headers only | View raw
On Sat, Jan 4, 2014 at 2:33 AM, Grant Edwards <invalid@invalid.invalid> wrote:
> time.time() returns a Python float. A Python float will have 16 digits
> of precision. Perhaps the OS always sets some of those digits to 0 (or
> even random values), but they're still there. Perhaps the accuracy or
> granularity of the values returned is problematic on some OSes, but
> the precision of the value doesn't change: there's no way he's "only
> getting 2 decimal places" from time.time() unless (as you mention
> below) he's printing them using a method that truncates/rounds.
If I print out the value float("1.01"), I get just three digits. When
those trailing digits are all zeroes, they won't be displayed. That's
exactly what the OP was seeing.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
need to print seconds from the epoch including the millisecond matt.doolittle33@gmail.com - 2013-12-26 10:32 -0800
Re: need to print seconds from the epoch including the millisecond Dan Stromberg <drsalists@gmail.com> - 2013-12-26 11:22 -0800
Re: need to print seconds from the epoch including the millisecond matt.doolittle33@gmail.com - 2013-12-26 14:06 -0800
Re: need to print seconds from the epoch including the millisecond Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-27 09:34 +1100
Re: need to print seconds from the epoch including the millisecond Grant Edwards <invalid@invalid.invalid> - 2014-01-02 16:23 +0000
Re: need to print seconds from the epoch including the millisecond Dave Angel <davea@davea.name> - 2014-01-02 21:41 -0500
Re: need to print seconds from the epoch including the millisecond Grant Edwards <invalid@invalid.invalid> - 2014-01-03 15:33 +0000
Re: need to print seconds from the epoch including the millisecond Chris Angelico <rosuav@gmail.com> - 2014-01-04 02:41 +1100
Re: need to print seconds from the epoch including the millisecond Dave Angel <davea@davea.name> - 2013-12-26 17:48 -0500
Re: need to print seconds from the epoch including the millisecond Terry Reedy <tjreedy@udel.edu> - 2013-12-26 20:03 -0500
Re: need to print seconds from the epoch including the millisecond Roy Smith <roy@panix.com> - 2013-12-26 20:29 -0500
Re: need to print seconds from the epoch including the millisecond matt.doolittle33@gmail.com - 2013-12-27 07:43 -0800
Re: need to print seconds from the epoch including the millisecond Dave Angel <davea@davea.name> - 2013-12-26 23:54 -0500
Re: need to print seconds from the epoch including the millisecond matt.doolittle33@gmail.com - 2013-12-27 07:42 -0800
Re: need to print seconds from the epoch including the millisecond matt.doolittle33@gmail.com - 2013-12-27 07:40 -0800
Re: need to print seconds from the epoch including the millisecond Dave Angel <davea@davea.name> - 2013-12-27 11:20 -0500
Re: need to print seconds from the epoch including the millisecond Roy Smith <roy@panix.com> - 2013-12-27 11:27 -0500
Re: need to print seconds from the epoch including the millisecond matt.doolittle33@gmail.com - 2013-12-27 10:09 -0800
Re: need to print seconds from the epoch including the millisecond Roy Smith <roy@panix.com> - 2013-12-27 13:50 -0500
Re: need to print seconds from the epoch including the millisecond Roy Smith <roy@panix.com> - 2013-12-27 13:53 -0500
Re: need to print seconds from the epoch including the millisecond Roy Smith <roy@panix.com> - 2013-12-27 20:15 -0500
Re: need to print seconds from the epoch including the millisecond Ned Batchelder <ned@nedbatchelder.com> - 2013-12-27 13:49 -0500
Re: need to print seconds from the epoch including the millisecond matt.doolittle33@gmail.com - 2013-12-30 04:16 -0800
Re: need to print seconds from the epoch including the millisecond Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-30 14:14 +0000
Re: need to print seconds from the epoch including the millisecond Cousin Stanley <cousinstanley@gmail.com> - 2013-12-30 10:07 -0700
Re: need to print seconds from the epoch including the millisecond Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-30 17:35 +0000
Re: need to print seconds from the epoch including the millisecond Cousin Stanley <cousinstanley@gmail.com> - 2013-12-30 11:17 -0700
Re: need to print seconds from the epoch including the millisecond Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-31 05:57 +1100
Re: need to print seconds from the epoch including the millisecond Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-12-27 13:14 -0500
Re: need to print seconds from the epoch including the millisecond Cameron Simpson <cs@zip.com.au> - 2013-12-28 11:25 +1100
Re: need to print seconds from the epoch including the millisecond matt.doolittle33@gmail.com - 2013-12-29 18:44 -0800
Re: need to print seconds from the epoch including the millisecond Ned Batchelder <ned@nedbatchelder.com> - 2013-12-30 07:50 -0500
Re: need to print seconds from the epoch including the millisecond Roy Smith <roy@panix.com> - 2013-12-30 09:22 -0500
Re: need to print seconds from the epoch including the millisecond Ned Batchelder <ned@nedbatchelder.com> - 2013-12-30 08:01 -0500
Re: need to print seconds from the epoch including the millisecond matt.doolittle33@gmail.com - 2013-12-30 05:40 -0800
Re: need to print seconds from the epoch including the millisecond Ned Batchelder <ned@nedbatchelder.com> - 2013-12-27 21:10 -0500
Re: need to print seconds from the epoch including the millisecond Steven D'Aprano <steve@pearwood.info> - 2013-12-28 03:50 +0000
csiph-web