Alt e.pl

From Organic Design wiki
Revision as of 17:09, 22 May 2015 by Nad (talk | contribs) (fix up code blocks)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
# Returns e^x from e( x, iterations )
sub e {
	$x = $y = shift;
	$top = $bot = 1;
	for $n ( 1 .. shift ) {
		$y = $y + $x;
		$top = $top * $n + $y;
		$bot = $bot * $n;
	}
	return $top / $bot;
}