From 4b88b73bd65cf8efe54d18cca02a871df7e77b61 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 12 Nov 2010 22:47:55 +0100 Subject: [PATCH] bin/calc: Add. A simple wrapper for python providing fast access to calculator functions. --- bin/calc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/calc 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."' -- 2.45.2