2

PHP Code 1

<?php 
 $a = 0.03;
 $b = 0.01 + 0.02;
 var_dump($a == $b);
?>

Output 1

bool(true)

PHP Code 2

<?php 
 $a = 0.3;
 $b = 0.1 + 0.2;
 var_dump($a == $b);
?>

Output 2

bool(false)

What is the Difference between the above two codes, Why its lead to two different Output. Can anyone please provide me the explanation which i seek. I am kind of Confused by looking at this.

0 Answers0