Skip Menu |
 

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

Report information
The Basics
Id: 124790
Status: resolved
Priority: 0/
Queue: Math-BigInt

People
Owner: Nobody in particular
Requestors: peter.john.acklam [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.999812



Subject: Accuracy and precision are both set in some cases
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-15900-1521225422-628.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 652
Download (untitled) / with headers
text/plain 652b
The following code causes both the precision and the accuracy to be set, which is illegal, so $x becomes NaN, not 5. In addition, the returned precision and accuracy are the class variables, not the instance variables set via new(). ===BEGIN-CODE=== use Math::BigInt; # set class variable Math::BigInt->precision(-4); # specify accuracy to the constructor my $x = Math::BigInt->new(5, 3, undef); say "x = ", $x; say "a = ", $x->accuracy() // "undef"; say "p = ", $x->precision() // "undef"; ===END-CODE=== The output is x = NaN a = undef p = -4 but should have been x = 5 a = 3 p = undef This bug is present in all versions of Math::BigInt.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.