in reply to log(0.5) with bignum blows up

Hmm .. I suppose you want Math::BigNum and not the unknown bugnum module.

And .. after that, this module does have log functions ..

... $x->blog(); # logarithm of $x to base e (Euler's number) $x->blog($base); # logarithm of $x to base $base (e.g., base 2) $x->bexp(); # calculate e ** $x where e is Euler's number $x->bilog2(); # log2($x) rounded down to nearest int $x->bilog10(); # log10($x) rounded down to nearest int $x->bclog2(); # log2($x) rounded up to nearest int $x->bclog10(); # log19($x) rounded up to nearest int ...
The log functions are called blog.

If I run this ..

tab@music4:~/Pianoforte/Perlmonks 21:54:45 $ cat !$ cat 11156670.pl #!/usr/bin/perl use strict; use warnings; # use Math::BigNum; { print "Log of .5 is " . log(0.5) . "\n"; } tab@music4:~/Pianoforte/Perlmonks 21:54:51 $ ./11156670.pl Log of .5 is -0.693147180559945 tab@music4:~/Pianoforte/Perlmonks 21:54:57 $
.. I get a good value. That presumably uses Perl's built in log function.

I can strongly recommend a complete, self-contained example that shows the output .. this will help you solve things faster.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.