#!/bin/sh
-# Copyright (C) 2011-2013 Simon Ruderich
+# Copyright (C) 2011-2014 Simon Ruderich
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -eu
+
exec python -i -c '
# Math functions.
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)
+# Convert number to scientific notation (e.g. 5e6).
+def s(x):
+ print "%e" % x
+
# Time/Date functions.
import time