PROTECTED]
Sent: 13 August 2008 05:39
To: Micah Gersten
Cc: Jim Lucas; Jay Blanchard; php-general@lists.php.net
Subject: Re: [PHP] More math fun
On Tue, 2008-08-12 at 23:23 -0500, Micah Gersten wrote:
Robert, when you do yours, it's performing the same function on two
different variable
On Wed, 2008-08-13 at 08:14 +0100, Alex Chamberlain wrote:
1.7763568394E-15 is 0. The computer just had a rounding error somewhere. We
had this discussion a few weeks ago, the solution being to decide to what
accuracy you want the answer. Upto 14 decimal places will give you 0 here!!
I thought
[snip]
1.7763568394E-15 is 0. The computer just had a rounding error
somewhere. We
had this discussion a few weeks ago, the solution being to decide to
what
accuracy you want the answer. Upto 14 decimal places will give you 0
here!!
I thought we had a different discussion a couple of weeks ago
Jay Blanchard wrote:
[snip]
1.7763568394E-15 is 0. The computer just had a rounding error
somewhere. We
had this discussion a few weeks ago, the solution being to decide to
what
accuracy you want the answer. Upto 14 decimal places will give you 0
here!!
I thought we had a different
On Wed, 2008-08-13 at 07:47 -0700, Jim Lucas wrote:
Jay Blanchard wrote:
[snip]
1.7763568394E-15 is 0. The computer just had a rounding error
somewhere. We
had this discussion a few weeks ago, the solution being to decide to
what
accuracy you want the answer. Upto 14 decimal places
On Tue, 2008-08-12 at 15:18 -0500, Jay Blanchard wrote:
abs($balanceTest) = 15.22
abs($oldLineArray[16]) = 15.22
$diff = abs($balanceTest) - abs($oldLineArray[16]);
echo abs($diff) . \n;
1.7763568394E-15
WTF? This should be a big fat 0
Please provide the list with the following
[snip]
Please provide the list with the following output:
?php
var_dump( $balanceTest );
var_dump( $oldLineArray[16] );
?
Methinks you have different data types.
[/snip]
string(5) 15.22
float(15.22)
You're right*smacks forehead*. Sometimes this whole forest and trees
thing kills me.
--
[snip]
?php
var_dump( $balanceTest );
var_dump( $oldLineArray[16] );
?
Methinks you have different data types.
[/snip]
string(5) 15.22
float(15.22)
You're right*smacks forehead*. Sometimes this whole forest and trees
thing kills me.
[/snip]
settype($balanceTest, float) had no effect
--
[snip]
string(5) 15.22
float(15.22)
You're right*smacks forehead*. Sometimes this whole forest and trees
thing kills me.
[/snip]
settype($balanceTest, float) had no effect
[/snip]
$diff = round(abs($balanceTest), 2) - round(abs($oldLineArray[16]), 2);
Works? Does round convert the string
Jay Blanchard wrote:
abs($balanceTest) = 15.22
abs($oldLineArray[16]) = 15.22
$diff = abs($balanceTest) - abs($oldLineArray[16]);
echo abs($diff) . \n;
1.7763568394E-15
WTF? This should be a big fat 0
I do not see how it makes any difference if $balanceTest and $oldLineArray[16]
are
On Tue, 2008-08-12 at 14:59 -0700, Jim Lucas wrote:
Jay Blanchard wrote:
abs($balanceTest) = 15.22
abs($oldLineArray[16]) = 15.22
$diff = abs($balanceTest) - abs($oldLineArray[16]);
echo abs($diff) . \n;
1.7763568394E-15
WTF? This should be a big fat 0
I do not see how
Robert, when you do yours, it's performing the same function on two
different variable types and has to do a conversion before the function
works. He was doing a numeric function on a string which might be
giving the funky results.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
On Tue, 2008-08-12 at 23:23 -0500, Micah Gersten wrote:
Robert, when you do yours, it's performing the same function on two
different variable types and has to do a conversion before the function
works. He was doing a numeric function on a string which might be
giving the funky results.
13 matches
Mail list logo