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).""
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
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
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
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
5 matches
Mail list logo