Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: james2vegas [...] aim.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.9902
Fixed in: (no value)



Subject: Failing tests comparing inf to Inf
t/bare_mbi.t ........ 608/3615
Show quoted text
#   Failed test at t/bigintpm.inc line 206.
#          got: 'Inf'
#     expected: 'inf'

Show quoted text
#   Failed test at t/bigintpm.inc line 206.
#          got: '-Inf'
#     expected: '-inf'
t/bare_mbi.t ........ 3257/3615 # Looks like you failed 2 tests of 3615.
t/bare_mbi.t ........ Dubious, test returned 2 (wstat 512, 0x200)

t/bigintpm.t ........ 1/3621
Show quoted text
#   Failed test at t/bigintpm.inc line 206.
#          got: 'Inf'
#     expected: 'inf'
t/bigintpm.t ........ 763/3621
Show quoted text
#   Failed test at t/bigintpm.inc line 206.
#          got: '-Inf'
#     expected: '-inf'
t/bigintpm.t ........ 2396/3621 # Looks like you failed 2 tests of 3621.
t/bigintpm.t ........ Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/3621 subtests

t/sub_mbi.t ......... 520/3620
Show quoted text
#   Failed test at t/bigintpm.inc line 206.
#          got: 'Inf'
#     expected: 'inf'

Show quoted text
#   Failed test at t/bigintpm.inc line 206.
#          got: '-Inf'
#     expected: '-inf'
t/sub_mbi.t ......... 3257/3620 # Looks like you failed 2 tests of 3620.
t/sub_mbi.t ......... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/3620 subtests


bash-2.05a# perl -v

This is perl, v5.8.9 built for i386-freebsd

Download (untitled) / with headers
text/plain 506b
On Sat Nov 27 07:17:03 2010, JWRIGHT wrote: Show quoted text
> This is perl, v5.8.9 built for i386-freebsd
Could you show me how your Perl prints infinity? Please try with something like perl -wle 'print 1e99 ** 1e99' Older versions of Perl have several different ways of representing a numerical scalar infinity and Not-a-number. The test cases expect "inf" and "NaN" and nothing else. The test cases should be modified so it allows the cases when Perl represents these values with something other than "inf" or "NaN".
Subject: Re: [rt.cpan.org #63379] Failing tests comparing inf to Inf
Date: Sun, 28 Nov 2010 09:06:20 +0100
To: bug-Math-BigInt [...] rt.cpan.org
From: Florian Ragwitz <rafl [...] debian.org>
Download (untitled) / with headers
text/plain 1.2k
"Peter John Acklam via RT" <bug-Math-BigInt@rt.cpan.org> writes: Show quoted text
> Queue: Math-BigInt > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=63379 > > > On Sat Nov 27 07:17:03 2010, JWRIGHT wrote: >
>> This is perl, v5.8.9 built for i386-freebsd
> > Could you show me how your Perl prints infinity? Please try with > something like > > perl -wle 'print 1e99 ** 1e99' > > Older versions of Perl have several different ways of representing a > numerical scalar infinity and Not-a-number. The test cases expect > "inf" and "NaN" and nothing else. The test cases should be modified so > it allows the cases when Perl represents these values with something > other than "inf" or "NaN".
Actually, that doesn't necessarily depend on the perl version. In most configurations and on most systems stringifying numbers is done by the C library of the system perl is running on. Unfortunately, there is no standard for how C libraries are supposed to stringify NaN and Inf. Common values are covered by /[+-]?inf/i and /[+-]?nan/i, but there's many more, such as '1.#INF' or '1.#IND' on win32. Perl does make no attempt at normalising this. I do happen to be working on a feature branch for perl to do that, but that is not quite finished yet and won't be available in a released version until 5.14 anyway.
Download (untitled)
application/pgp-signature 197b

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 294b
I thought this had been standardized in Perl, to take care of the problem with the differing C libraries, so that Perl now returns "inf" and "NaN" regardless of the underlying C library. I could be mistaken, though. Anyway, the test case must be changed to handle this, or temporarily removed.
Show quoted text
# perl -wle 'print 1e99 ** 1e99'
Inf

RT-Send-CC: rafl [...] debian.org
Download (untitled) / with headers
text/plain 876b
On HP-UX 11.11 PA-RISC/32 with perl5.12.2: $ perl -wle 'print 1e99 ** 1e99' ++ t/bare_mbi.t ........ 756/3615 # Failed test at t/bigintpm.inc line 206. # got: '++' # expected: 'inf' t/bare_mbi.t ........ 757/3615 # Failed test at t/bigintpm.inc line 206. # got: '---' # expected: '-inf' t/bigintpm.t ........ 762/3621 # Failed test at t/bigintpm.inc line 206. # got: '++' # expected: 'inf' t/bigintpm.t ........ 763/3621 # Failed test at t/bigintpm.inc line 206. # got: '---' # expected: '-inf' t/sub_mbi.t ......... 756/3620 # Failed test at t/bigintpm.inc line 206. # got: '++' # expected: 'inf' t/sub_mbi.t ......... 757/3620 # Failed test at t/bigintpm.inc line 206. # got: '---' # expected: '-inf' HP-UX 11.11 PA-RISC/64 with perl-5.12.2: $ perl -wle 'print 1e99 ** 1e99' ++
Download (untitled) / with headers
text/plain 411b
On Mon Nov 29 07:21:14 2010, HMBRAND wrote: Show quoted text
> > $ perl -wle 'print 1e99 ** 1e99' > ++
Thank you! I am working on a fix. By the way, is the output numeric? If you do $ perl -wle 'print 0 + 1e99 ** 1e99' do you get the same output, or do you get Argument "++" isn't numeric in addition (+) at -e line 1. 0 It would surprise me if you get the latter, but it would be nice if you could confirm that you don't.
The problem was non-portable tests. They have been removed. Fixed in Math-BigInt-1.991.


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.