I resolved the issue with the code that i was working, but this is something that bugs me out.
I know that floating point in certain circumnstances just messes up with rounding. I know that php uses types inferences, and there is an automatic cast when you operate aritmetically between strings (i mean, in this particular case, in my example).
Doing the same thing 'by hand in code', result of 160.2 * 50 is 8010, when there is no need for rounding when casting to the integer result. Is just ackward. If anyone knows why this happens, it will enlightment me.
echo "160.2" * "50"; // gives 8010
echo (int) ((float)"160.2" * (int)"50"); // Gives 8009
I solved the issue and my code is working now; this is just for fun. I want to know why and how, step by step php messes up with this. Where is php losing resolution? In what step?
Thanks in advance :)