I’m having trouble understanding how php calculates standard math functions. In a specific example I have this calculation:
225 + 154 * 256 + 138 * 256 * 256 + 81 * 256 * 256 * 256
(thats correct, no brackets)
which when executed with php produces this number:
1,368,038,113
Now when I look at this logically and work through the sum from left to right, this number doesn’t even come close. using a cheap simple calculator, it gives up trying to calculate it before the last two multiplications of 256 because the number gets too big.
How is it possible to end up with such a relatively small number from a calculation with 6 multiplications by 256?
A breakdown of how php actually would work out this answer would be great.
p.s. i read through this page: http://www.homeandlearn.co.uk/php/php2p8.html which still didn’t help me with the above.
=>
=>
=>
=>
EDIT
Why do I think you’re doing:
=>