Re: [PHP] More math fun

2008-08-13 Thread Robert Cummings
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 de

Re: [PHP] More math fun

2008-08-13 Thread Jim Lucas
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 discuss

RE: [PHP] More math fun

2008-08-13 Thread Jay Blanchard
[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 a

RE: [PHP] More math fun

2008-08-13 Thread Robert Cummings
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 thoug

RE: [PHP] More math fun

2008-08-13 Thread Alex Chamberlain
mailto:[EMAIL 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

Re: [PHP] More math fun

2008-08-12 Thread Robert Cummings
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. T

Re: [PHP] More math fun

2008-08-12 Thread Micah Gersten
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 http

Re: [PHP] More math fun

2008-08-12 Thread Robert Cummings
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 > >

Re: [PHP] More math fun

2008-08-12 Thread Jim Lucas
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 stri

RE: [PHP] More math fun

2008-08-12 Thread Jay Blanchard
[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 strin

RE: [PHP] More math fun

2008-08-12 Thread Jay Blanchard
[snip] 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

RE: [PHP] More math fun

2008-08-12 Thread Jay Blanchard
[snip] Please provide the list with the following output: 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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

Re: [PHP] More math fun

2008-08-12 Thread Robert Cummings
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 follow