use bc -l define fact (x) { if(x < 1) return 1 return (x*fact(x-1)) } define ld (x) { return l(x)/l(2) }