]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
bin/calc: Add.
authorSimon Ruderich <simon@ruderich.org>
Fri, 12 Nov 2010 21:47:55 +0000 (22:47 +0100)
committerSimon Ruderich <simon@ruderich.org>
Fri, 12 Nov 2010 21:47:55 +0000 (22:47 +0100)
A simple wrapper for python providing fast access to calculator
functions.

bin/calc [new file with mode: 0755]

diff --git a/bin/calc b/bin/calc
new file mode 100755 (executable)
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."'