I was using below formula in PHP. It was working fine till PHP 7.4. Now I have upgraded to PHP 8.1 and it’s giving error.
<?php
echo ((float)13.5 + intdiv((float)13.5, (int)10) * (float)2.5 / (int)12);
I’m getting error Exception: Deprecated Functionality: Implicit conversion from float 13.5 to int loses precision
How can I solve this? What is the reason for this error?