Bad math operation (multiplication) in PHP - it is a bug?

113 Views Asked by At

With this code:

<?php
echo (int)(130.98 * 100) . "\n";
echo (int)(30.98 * 100) . "\n";
echo (int)(0.98 * 100) . "\n";

I get output:

13097
3098
98

Why is the first result 13097 ???

0

There are 0 best solutions below