From 78ed4e167ea4bf3ba1b03cc64ea02e6d4184cf77 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 27 Dec 2013 17:09:45 +0100 Subject: [PATCH] bin/calc: Add lg() as shortcut for log10(). --- bin/calc | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.45.2