X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Fcalc;h=9fa35d378dab8a69f508cf2529c04a29aded4a18;hb=17a3d6bf1dc5001799987d03b0e890f84a373ac9;hp=c3641191956eded9510788bf714523669d360aac;hpb=a0e89499b7a01724b8a2806805d8432e30e4aace;p=config%2Fdotfiles.git diff --git a/bin/calc b/bin/calc index c364119..9fa35d3 100755 --- a/bin/calc +++ b/bin/calc @@ -27,6 +27,10 @@ def ld(x): def binom(n,k): return reduce(lambda a,b: a*(n-b)/(b+1),xrange(k),1) +# Convert number to scientific notation (e.g. 5e6). +def s(x): + print "%e" % x + # Time/Date functions. import time