Re: [PHP] Math weirdness with doubles...

2004-02-27 Thread Marek Kilimajer
jon roig wrote: Ok... It's Friday and maybe my brain is dead, but I'm having a weird problem with some basic math. Here's a little snippet of the code I'm working with: --- echo "Current:$currentAmount:".gettype($currentAmount)." - Paid:$paidAmount:".gettype($paidAmount).""

RE: [PHP] Math weirdness with doubles...

2004-02-27 Thread Daniel Clark
riginal Message- > From: Daniel Clark [mailto:[EMAIL PROTECTED] > Sent: Friday, February 27, 2004 3:16 PM > To: jon roig > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Math weirdness with doubles... > > > Looks like the Doubles are not exactly zero. Must be some precision &g

RE: [PHP] Math weirdness with doubles...

2004-02-27 Thread jon roig
Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Math weirdness with doubles... Looks like the Doubles are not exactly zero. Must be some precision points not displaying. > Ok... It's Friday and maybe my brain is dead, but I'm having a weird > problem with some basic math. > > H

Re: [PHP] Math weirdness with doubles...

2004-02-27 Thread D. Wokan
They are not the same amount. They each got a different rounding error. Double values only display a small number of decimal places (relatively speaking). If you look at the difference you're getting, it's 0.0142108547152 (I may be off by a zero or two), so given you're working w

Re: [PHP] Math weirdness with doubles...

2004-02-27 Thread Daniel Clark
Looks like the Doubles are not exactly zero. Must be some precision points not displaying. > Ok... It's Friday and maybe my brain is dead, but I'm having a weird > problem with some basic math. > > Here's a little snippet of the code I'm working with: > > --- > echo "Curr

[PHP] Math weirdness with doubles...

2004-02-27 Thread jon roig
Ok... It's Friday and maybe my brain is dead, but I'm having a weird problem with some basic math. Here's a little snippet of the code I'm working with: --- echo "Current:$currentAmount:".gettype($currentAmount)." - Paid:$paidAmount:".gettype($paidAmount).""; $currentAmou