Hailwood Posted July 14, 2010 Share Posted July 14, 2010 hi there, well here is what i am doing: $flybuys: 6014359000000928 $check: 8 $total = (array_sum($odds))+$evens; $total = str_split($total); $check = 10 - $total[1]; echo $flybuys.' % '.$check.': '.$flybuys % $check.'<br />'; $res = $flybuys % $check; echo 'res: '.$res; and the output is: 6014359000000928 % 8: 7 res: 7 yet if i do: echo 6014359000000928 % 8; i get: 0;, which is correct so where is the 7 coming from? Quote Link to comment Share on other sites More sharing options...
Mchl Posted July 14, 2010 Share Posted July 14, 2010 6014359000000928 is larger than 32 bit integer, so PHP casts it to float. This may result in unexpected results. For numbers like this use bc_math functions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.