PHP Math & Bracket explanation

cymnmaype

New Member
In my php code I have the following:\[code\]$step1 = ((1 - (($periodHigh - $last[$symbol]) / ($periodHigh - $periodLow))) - (($periodHigh - $last[$symbol]) / ($periodHigh - $periodLow))) * 100;\[/code\]From the generated php, This is what I get:\[code\]((1 - ((77.70 - 77.69) / (77.70 - 76.59))) - ((77.70 - 77.69) / (77.70 - 76.59))) * 100 = -26.13\[/code\]But, if I paste the formula into Google or any calculator, I get the following:\[code\]((1 - ((77.70 - 77.69) / (77.70 - 76.59))) - ((77.70 - 77.69) / (77.70 - 76.59))) * 100 = 98.1981982\[/code\]I was wondering if anyone can pin-point what is wrong with the brackets and interpretation in php?
 
Back
Top