Skip Menu |
 

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

Report information
The Basics
Id: 15896
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Math-BigInt

People
Owner: TELS [...] cpan.org
Requestors: bricas [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.77
Fixed in: (no value)



Subject: "==" overloading is broken for "NaN"
Download (untitled) / with headers
text/plain 983b
Hi, This stems from a bug report filed in Authen::TypeKey (http://rt.cpan.org/NoAuth/Bug.html?id=15895). The attached test shows that when comparing a "NaN" to a regular Math::BigInt, it returns true; though stringification shows otherwise. Here's the output on my machine: 1..4 ok 1 - The object isa Math::BigInt ok 2 - The object isa Math::BigInt $VAR1 = bless( { 'value' => [ 0 ], 'sign' => 'NaN' }, 'Math::BigInt' ); $VAR2 = bless( { 'value' => [ 12345 ], 'sign' => '+' }, 'Math::BigInt' ); ok 3 - $value1 should not equal $value2 (stringified) not ok 4 - $value1 should not equal $value2 (== overload) # Failed test (bigint.t at line 13) # Looks like you failed 1 test of 4. I've added some warnings to show what the variables look like underneath. -Brian
Download bigint.t
text/x-perl 427b
use Test::More tests => 4; use Math::BigInt; use Data::Dumper; my $value1 = Math::BigInt->new( 'foo' ); isa_ok( $value1, 'Math::BigInt' ); my $value2 = Math::BigInt->new( 12345 ); isa_ok( $value2, 'Math::BigInt' ); warn Dumper $value1, $value2; ok( !( "$value1" == "$value2" ), '$value1 should not equal $value2 (stringified)' ); ok( !( $value1 == $value2 ), '$value1 should not equal $value2 (== overload)' );
Download (untitled) / with headers
text/plain 151b
I just released Math::BigInt 1.80 to CPAN, which fixes this issue in both BigInt and BigFloat. Thank you for your report, and sorry for the long delay.


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.