Skip to content

Instantly share code, notes, and snippets.

@goulu
Last active May 26, 2017 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goulu/a7332063593056348c6de43239f7f119 to your computer and use it in GitHub Desktop.
Save goulu/a7332063593056348c6de43239f7f119 to your computer and use it in GitHub Desktop.
Finds a better constant than 299792458 to define the meter
from fractions import gcd
s=9192631770 # number of caesium oscillations in a second
bestm=299792458 # fraction of a second in a meter
bestgcd=gcd(s,bestm) #14 . we want a larger one
for m in range(299792458, 300000000):
g=gcd(s,m)
if g>bestgcd:
bestm,bestgcd=m,g
print(bestgcd,bestm,s/bestgcd,m/bestgcd)
@goulu
Copy link
Author

goulu commented May 26, 2017

for my article about the speed of light and the definition of the meter https://www.drgoulu.com/2017/05/26/pourquoi-on-ne-peut-plus-mesurer-la-vitesse-de-la-lumiere/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment