From 66f3164bda5144bc104e526d832157b59d0eec95 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. --- scripts/sdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sdate b/scripts/sdate index daddd5b..a33cf6d 100755 --- a/scripts/sdate +++ b/scripts/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]