From cbb52a3db2de5861e0d37c7495d94fbe4c22800e Mon Sep 17 00:00:00 2001 From: nirenjan Date: Fri, 3 May 2013 22:26:43 -0700 Subject: [PATCH] Improve precision on stardate script There is a possibility that for every 0.1 stardates (8640 seconds), the final 0.05 stardate would get rounded up (432 seconds). This kind of inaccuracy is unacceptable by Starfleet standards, so I've reduced the inaccuracy to 5e-10 stardates or 43.2 microseconds. --- sdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdate b/sdate index daddd5b..a33cf6d 100755 --- a/sdate +++ b/sdate @@ -12,5 +12,5 @@ t = time.time() jd = (t / 86400.0 + 40587.5) # Use the idea that 10 Julian days is equal to 1 stardate -print ("%05.3f" % jd)[:-1] +print ("%05.9f" % jd)[:-7]