e.pl

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