]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
bin/calc: Add lg() as shortcut for log10().
authorSimon Ruderich <simon@ruderich.org>
Fri, 27 Dec 2013 16:09:45 +0000 (17:09 +0100)
committerSimon Ruderich <simon@ruderich.org>
Fri, 27 Dec 2013 16:09:45 +0000 (17:09 +0100)
bin/calc

index 9fa35d378dab8a69f508cf2529c04a29aded4a18..f76472f00ef56512a0a873b78ca5dd99add244f4 100755 (executable)
--- a/bin/calc
+++ b/bin/calc
@@ -23,6 +23,8 @@ 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)