log is overloaded with
which returns just NaN with perl 5.8.0; there the routine reads'log' => sub { $_[0]->copy()->blog($_[1]); },
sub blog { # not implemented yet my ($self,$x,$base,$a,$p,$r) = ref($_[0]) ? (ref($_[0]),@_) : object +ify(1,@_); return $upgrade->blog($x,$base,$a,$p,$r) if defined $upgrade; return $x->bnan(); }
In 5.8.8 the "not implemented" comment went away, but alas, there's still no base for blog to work with. blog calls _int_log
my ($rc,$exact) = $CALC->_log_int($x->{value},$base->{value});
- but $base->{value} is just undef -
sub _log_int { # calculate integer log of $x to base $base # ref to array, ref to array - return ref to array my ($c,$x,$base) = @_; # X == 0 => NaN return if (scalar @$x == 1 && $x->[0] == 0); # BASE 0 or 1 => NaN return if (scalar @$base == 1 && $base->[0] < 2);
- which names that value $base (poor practive imho to use a scalar named $base as a hash- and arrayref in different parts of the code) and tries to dereference it as an arrayref. Bummer.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: bug in bigint?
by shmem
in thread bug in bigint?
by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |