[Python-ideas] Why not picoseconds?

Stephan Houben stephanh42 at gmail.com
Mon Oct 16 03:46:00 EDT 2017

Hi all,

I realize this is a bit of a pet peeve of me, since
in my day job I sometimes get people complaining that
numerical data is "off" in the sixteenth significant digit
(i.e. it was stored as a double).

I have a bunch of favorite comparisons to make this clear
how accurate a "double" really is: you can measure the
distance to Neptune down to a millimeter with it, or
the time from the extinction of the dinosaurs until
now down to half-second resolution.

Unfortunately for my argument, measuring time is one
of the most accurate physical measurements we can make,
and the best of the best exceed double-precision accuracy.

For example, the best atomic clock
achieves a measurement uncertainty of 3e-18, which is about two order of
magnitudes more accurate than what double-precision gives you;
the latter runs out of steam at 2.2e-16.

So I realize there is obvious a strong need for (the illusion of)
such precise time keeping in the Python API <wink>.

Interestingly, that 2.2e-16 pretty much aligns with the accuracy of the
cesium atomic clocks which are currently used to *define* the second.
So we move to this new API, we should provide our own definition
of the second, since those rough SI seconds are just too imprecise for that.


2017-10-16 9:03 GMT+02:00 Stefan Krah <stefan at bytereef.org>:

> On Mon, Oct 16, 2017 at 08:40:33AM +0200, Stephan Houben wrote:
> > "The problem is that Python returns time as a floatting point number
> > > which is usually a 64-bit binary floatting number (in the IEEE 754
> > > format). This type starts to loose nanoseconds after 104 days."
> > >
> > >
> > Do we realize that at this level of accuracy, relativistic time
> dilatation
> > due
> > to continental drift starts to matter?
> tai64na has supported attoseconds for quite some time:
>     https://cr.yp.to/libtai/tai64.html
> The relativity issue is declared to be out of scope for the document. :-)
> Stefan Krah
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171016/b5d109a7/attachment.html>

More information about the Python-ideas mailing list