]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - bin/calc
shell/rc: Rename timeout_setup_shell_lock() to _logout().
[config/dotfiles.git] / bin / calc
index c3641191956eded9510788bf714523669d360aac..f76472f00ef56512a0a873b78ca5dd99add244f4 100755 (executable)
--- a/bin/calc
+++ b/bin/calc
@@ -23,10 +23,16 @@ from math import *
 
 def ld(x):
     return log(x)/log(2)
+def lg(x):
+    return log10(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