Skip Menu |

This queue is for tickets about the Math-BigInt CPAN distribution.

Report information
The Basics
Id: 108643
Status: open
Priority: 0/
Queue: Math-BigInt

People
Owner: Nobody in particular
Requestors: TRIZEN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in:
  • 1.999708
  • 1.999709
Fixed in: (no value)



Subject: A rational power and a negative base produces a "uninitialized" warning
Considering the following code: === BEGIN-CODE === use Math::BigFloat; my $mone = Math::BigFloat->new(-1); my $three = Math::BigFloat->new(3); print $mone**($mone / $three); === END-CODE === Math::BigFloat produces the following warning: Use of uninitialized value in numeric le (<=) at /usr/share/perl5/core_perl/Math/BigFloat.pm line 2555.
Thanks for the report. I have checked this case against old versions of Math::BigFloat, and it turns out that this is a very old bug. Math::BigFloat does not support complex numbers, so raising a negative number to a non-integer power should result in a NaN.
On Wed Nov 11 06:27:34 2015, pjacklam wrote: Show quoted text
> Thanks for the report. I have checked this case against old versions > of Math::BigFloat, and it turns out that this is a very old bug. > > Math::BigFloat does not support complex numbers, so raising a negative > number to a non-integer power should result in a NaN.
A related issue, which triggers a warning on the same line as the code above, is the following: === BEGIN-CODE === use Math::BigFloat; Math::BigFloat->precision(-10); # commenting this, the warning is not triggered my $x = Math::BigFloat->new(1.24); my $y = Math::BigFloat->new(9.14); CORE::say $x**$y; === END-CODE=== Outputs: Use of uninitialized value in numeric le (<=) at /usr/share/perl5/site_perl/Math/BigFloat.pm line 2555. 1.0000000000