develooper Front page | perl.vmsperl | Postings from June 2002

Re: [PATCH #2] Re: [PATCH] numeric.c:S_mulexp10 -- quit whenyou can

Thread Previous | Thread Next
From:
Craig A. Berry
Date:
June 19, 2002 11:19
Subject:
Re: [PATCH #2] Re: [PATCH] numeric.c:S_mulexp10 -- quit whenyou can
Message ID:
5.1.1.5.0.20020619125456.019f4dd8@mail.mac.com
At 03:27 PM 6/19/2002 +0100, Hugo van der Sanden wrote:
>"Craig A. Berry" <craigberry@mac.com> wrote:

>:$ perl -e "my $x = 100.000000000000000001; print $x;"
>:0
>
>Could you try the patch below? It doesn't break anything here, but
>I can't easily coerce my platform to use the new codepath.


Unfortunately it had no effect on the problem, which seems to occur not in 
the loop you patched but further down in the call that looks like:


    /* now apply the exponent */
    exponent += expextra;
    result = S_mulexp10(result, exponent);

The values of the parameters right before the call are

NUMERIC\Perl_my_atof2\result:   0.100000000000000E+21
NUMERIC\Perl_my_atof2\exponent: -18

We do hit your new check 4 times, though we never pass the test and execute 
the "reduce precision" code.  Here's the output of the relevant values each 
time we do the check:

DBG> set module numeric
DBG> set break Perl_my_atof2\%line 43959 do (examine testresult, ipart, i, part[ipart-i], expextra)
DBG> g
break at NUMERIC\Perl_my_atof2\%LINE 43959
 43959:        if (testresult == 0.0 && part[ipart - i] != 0 && expextra < 0) {
NUMERIC\Perl_my_atof2\%LINE 43957\testresult:   0.000000000000000
NUMERIC\Perl_my_atof2\ipart:    0
NUMERIC\Perl_my_atof2\i:        0
NUMERIC\Perl_my_atof2\part[0]:  0
NUMERIC\Perl_my_atof2\expextra: 0
DBG> g
break at NUMERIC\Perl_my_atof2\%LINE 43959
 43959:        if (testresult == 0.0 && part[ipart - i] != 0 && expextra < 0) {
NUMERIC\Perl_my_atof2\%LINE 43957\testresult:   1.00000000000000
NUMERIC\Perl_my_atof2\ipart:    2
NUMERIC\Perl_my_atof2\i:        0
NUMERIC\Perl_my_atof2\part[2]:  1
NUMERIC\Perl_my_atof2\expextra: -18
DBG> g
break at NUMERIC\Perl_my_atof2\%LINE 43959
 43959:        if (testresult == 0.0 && part[ipart - i] != 0 && expextra < 0) {
NUMERIC\Perl_my_atof2\%LINE 43957\testresult:   0.000000000000000
NUMERIC\Perl_my_atof2\ipart:    2
NUMERIC\Perl_my_atof2\i:        1
NUMERIC\Perl_my_atof2\part[1]:  0
NUMERIC\Perl_my_atof2\expextra: -18
DBG> g
break at NUMERIC\Perl_my_atof2\%LINE 43959
 43959:        if (testresult == 0.0 && part[ipart - i] != 0 && expextra < 0) {
NUMERIC\Perl_my_atof2\%LINE 43957\testresult:   0.100000000000000E+21
NUMERIC\Perl_my_atof2\ipart:    2
NUMERIC\Perl_my_atof2\i:        2
NUMERIC\Perl_my_atof2\part[0]:  100000000
NUMERIC\Perl_my_atof2\expextra: -18
DBG> g
0
%DEBUG-I-EXITSTATUS, is '%SYSTEM-S-NORMAL, normal successful completion'



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About