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.
vimbundler
nirenjan 2013-05-03 22:26:43 -07:00
parent 489813cdc8
commit 66f3164bda
1 changed files with 1 additions and 1 deletions

View File

@ -12,5 +12,5 @@ t = time.time()
jd = (t / 86400.0 + 40587.5) jd = (t / 86400.0 + 40587.5)
# Use the idea that 10 Julian days is equal to 1 stardate # Use the idea that 10 Julian days is equal to 1 stardate
print ("%05.3f" % jd)[:-1] print ("%05.9f" % jd)[:-7]