Skip Menu |
Report information
Id: 971
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: mjtg [at] cus.cam.ac.uk
Cc:
AdminCc:

Operating System: generic
PatchStatus: (no value)
Severity: medium
Type: core
Perl Version: 5.005_03
Fixed In: (no value)



To: perlbug [...] perl.com
Subject: Math::BigFloat is not -w clean
From: "M.J.T. Guy" <mjtg [...] cus.cam.ac.uk>
Date: Wed, 07 Jul 1999 19:20:15 +0100
Download (untitled) / with headers
text/plain 967b
$x = Math::BigFloat->new(123); gives "undefined" warnings. Patch attached for 5.005_03, but should be OK for other versions. I note in passing that there are no regression tests for this module, but my enthusiasm didn't stretch to providing some. :-( Mike Guy And a message from our sponsors: perl perl perl perl perl perl perl --- ./lib/Math/BigFloat.pm.orig Thu Jan 7 04:41:53 1999 +++ ./lib/Math/BigFloat.pm Wed Jul 7 16:05:05 1999 @@ -76,8 +76,10 @@ sub fnorm { #(string) return fnum_str local($_) = @_; s/\s+//g; # strip white space - if (/^([+-]?)(\d*)(\.(\d*))?([Ee]([+-]?\d+))?$/ && "$2$4" ne '') { - &norm(($1 ? "$1$2$4" : "+$2$4"),(($4 ne '') ? $6-length($4) : $6)); + if (/^([+-]?)(\d*)(\.(\d*))?([Ee]([+-]?\d+))?$/ && + (length $2 || defined $4) { + my $x = defined $4 ? $4 : ''; + &norm(($1||'+') . "$2$x", ($6||0)-length($x)); } else { 'NaN'; } End of patch
To: perlbug [...] perl.org
Subject: Re: [ID 19990707.005] Math::BigFloat is not -w clean
Date: Wed, 26 Jul 2000 15:56:38 -0400
From: "Stephen P. Potter" <spp [...] ds.net>
Download (untitled) / with headers
text/plain 1.1k
Original message from M.J.T. Guy (patch typo fixed as well). This is still true in 5.6.0. Math::BigFloat is not -w clean. For example, $x = Math::BigFloat->new(123); gives "undefined" warnings. Patch attached for 5.005_03, but should be OK for other versions. I note in passing that there are no regression tests for this module, but my enthusiasm didn't stretch to providing some. :-( Mike Guy And a message from our sponsors: perl perl perl perl perl perl perl --- ./lib/Math/BigFloat.pm.orig Thu Jan 7 04:41:53 1999 +++ ./lib/Math/BigFloat.pm Wed Jul 7 16:05:05 1999 @@ -76,8 +76,10 @@ sub fnorm { #(string) return fnum_str local($_) = @_; s/\s+//g; # strip white space - if (/^([+-]?)(\d*)(\.(\d*))?([Ee]([+-]?\d+))?$/ && "$2$4" ne '') { - &norm(($1 ? "$1$2$4" : "+$2$4"),(($4 ne '') ? $6-length($4) : $6)); + if (/^([+-]?)(\d*)(\.(\d*))?([Ee]([+-]?\d+))?$/ && + (length $2 || defined $4)) { + my $x = defined $4 ? $4 : ''; + &norm(($1||'+') . "$2$x", ($6||0)-length($x)); } else { 'NaN'; } End of patch


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

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org