After finding blazar's bug in bigint? posting, I decided to beat on bignum to see how it handled logs (generally, as far as I could tell, perfectly well). However, this gave me a surprise:
returns this:#!perl use warnings; use strict; use bignum; my $n = -1; print "10 ** $n = " . 10 ** $n . "\n";
10 ** -1 = NaN
which is, obviously, wrong. I'm using ActiveState Perl, (Binary build 819 [267479]). Has anybody seen this with other Perls? (Please don't tell me it should be undefined; the answer should be 0.1, which it is if the use bignum; line is commented out). I've submitted a bug to ActiveState, but I'm curious as to whether it's more basic than that.
I've filed a bug report (http://rt.perl.org/rt3/Ticket/Display.html?id=41050.). Now, to try to come up with a patch...
emc
At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.
—Igor Sikorsky, reported in AOPA Pilot magazine February 2003.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use bignum and exponentiation
by syphilis (Archbishop) on Dec 02, 2006 at 00:28 UTC | |
by swampyankee (Parson) on Dec 03, 2006 at 02:40 UTC | |
by syphilis (Archbishop) on Dec 03, 2006 at 06:53 UTC | |
by swampyankee (Parson) on Dec 04, 2006 at 02:53 UTC | |
by belg4mit (Prior) on Dec 09, 2006 at 01:51 UTC | |
|
Re: use bignum and exponentiation
by rhesa (Vicar) on Dec 01, 2006 at 23:32 UTC | |
by geekphilosopher (Friar) on Dec 03, 2006 at 16:50 UTC | |
|
Re: use bignum and exponentiation
by sgt (Deacon) on Dec 04, 2006 at 23:56 UTC |