http://qs321.pair.com?node_id=652437


in reply to Exponential Function Programming

I think that this is more noble and incomprehensible :>)
#!/usr/bin/perl use strict; use warnings; sub exp_ { my $x = shift; my ($d, $ret, $i) = (1.0, 1); while ($ret - $d != $ret) { $d *= $x/++$i; $ret += $d; } return $ret; } for (1..100) { print "exp($_) = ".exp_($_)."\n"; }