From: Simon Ruderich Date: Fri, 12 Nov 2010 21:47:55 +0000 (+0100) Subject: bin/calc: Add. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=4b88b73bd65cf8efe54d18cca02a871df7e77b61;p=config%2Fdotfiles.git bin/calc: Add. A simple wrapper for python providing fast access to calculator functions. --- diff --git a/bin/calc b/bin/calc new file mode 100755 index 0000000..a71e783 --- /dev/null +++ b/bin/calc @@ -0,0 +1,11 @@ +#!/bin/sh + +python -i -c 'from math import *; + +def ld(x): + return log(x)/log(2) + +def binom(n,k): + return reduce(lambda a,b: a*(n-b)/(b+1),xrange(k),1) + +print "Welcome to the ultimate calculator."'