From: Simon Ruderich Date: Fri, 27 Dec 2013 16:09:45 +0000 (+0100) Subject: bin/calc: Add lg() as shortcut for log10(). X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=78ed4e167ea4bf3ba1b03cc64ea02e6d4184cf77;p=config%2Fdotfiles.git bin/calc: Add lg() as shortcut for log10(). --- diff --git a/bin/calc b/bin/calc index 9fa35d3..f76472f 100755 --- 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)