Float number compared to a sum doesn’t match?

Asked

Viewed 25 times

1

$a=3787.97;
$b=3000.00+787.97;

echo $a . " # ". $b . "</br>";

var_dump($a==$b);
var_dump($a);
var_dump($b);

Upshot :

3787.97 # 3787.97
bool(false) float(3787.97) float(3787.97) 

Why bool(false)?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.