From: Chip Salzenberg Date: Tue, 18 Oct 1994 16:35:28 +0000 (+1200) Subject: Don't use $4 when it might be undef X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=afea815c58c54233979716dd5770b69df2df51f8;p=p5sagit%2Fp5-mst-13.2.git Don't use $4 when it might be undef --- diff --git a/lib/bigfloat.pl b/lib/bigfloat.pl index 9ad171f..d687c78 100644 --- a/lib/bigfloat.pl +++ b/lib/bigfloat.pl @@ -41,8 +41,10 @@ $rnd_mode = 'even'; sub main'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+))?$/ + && ($2 ne '' || defined($4))) { + my $x = defined($4) ? $4 : ''; + &norm(($1 ? "$1$2$x" : "+$2$x"), (($x ne '') ? $6-length($x) : $6)); } else { 'NaN'; }