Thought of that, which is why I tried:

$l = 68288455.49 - 67947269.62

which also gave the same result.

-----Original Message-----
From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 9:01 AM
To: '[EMAIL PROTECTED] '; '[EMAIL PROTECTED] '
Subject: RE: Strange total from adding 2 numbers


It looks like the negative number is being entered as a string.  How are you
entering the second Acct_Bal_Raw variable initially?
-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 5/23/02 8:47 AM
Subject: Strange total from adding 2 numbers

Why is the addition of the numbers -67947269.62 and 68288455.49, both
with
only 2 numbers after the decimal, resulting in 341185.86999996 where
there
are 8 numbers after the decimal.  I would expect the number to simply be
341185.87.  How can i avoid this strange behavior?

Below are 2 examples, both are shown from the debugger.


  DB<10> x $funds_type_totals{$funds_type}
0  68288455.49
  DB<11> x $Deposit_Acct_Bal_Raw
0  '-67947269.62'
  DB<12> s
161:      $Deposit_Acct_Bal_Raw +=  $funds_type_totals{$funds_type};
  DB<12> x $Deposit_Acct_Bal_Raw
0  341185.86999996


=======

  DB<18> $l = 68288455.49 -67947269.62

  DB<19> x $l
0  341185.86999999

Reply via email to