Forwarded message:
>From [EMAIL PROTECTED]  Mon Oct 23 17:47:44 1995
Date: Mon, 23 Oct 1995 12:47:22 -0400 (EDT)
From: Fernando <[EMAIL PROTECTED]>
To: "J.H.M.Dassen" <[EMAIL PROTECTED]>
Subject: Re: Bug#1732: Bad arithmetic in new perl packages
In-Reply-To: <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


While trying to isolate the bug in perl-5.001-5  I managed to reproduce it
also with perl-5.001-3, although the output is not exactly the same.
I have tried the script below in two machines (a 386SX and a 486DX) with
the same result. It seems to be some conversion problem. It happens more
often in perl-5.001m because I noticed when I upgraded and my scripts
started to fail.

This is the test script:

------------------------------------------------------------
#!/usr/bin/perl

@array=(
"item1 4 units",
"item2 1.5 units",
"item3 8 units + see item2"
);

foreach (@array) {
        if( ($item_name,$amount,$unit,$delimiter,$moreinfo)=
                /^(\w+)\s*([\d\.]+)\s*(\w+)\s*(\+|$)\s*(.*)/) {
                $total+=$amount;
                }
        }

$Total=$total;
print "total=$total\n";
print "Total=$Total\n";
-----------------------------------------------------------------

Output from perl-5.001-5:
total=13.5
Total=13.5000000003576

Output from perl-5.001-3:
total=13.5
Total=13.5000000005364

Thanks,
        Fernando.


--
J.H.M. Dassen                 | RUMOUR  Believe all you hear. Your world may
[EMAIL PROTECTED]      | not be a better one than the one the blocks
[EMAIL PROTECTED]  | live in but it'll be a sight more vivid.
                              |     - The Hipcrime Vocab by Chad C. Mulligan

Reply via email to