Floating point values

Проблема:

	$v=2.06667;
	echo var_dump($v*100000)."\n";
	echo var_dump(round($v*100000,0));
	echo "\nIs equal ? "; 
	echo  ($v*100000==round($v*100000,0)) ? "true" : "false";

Обяснението:

        ini_set('precision',32);
	$v=2.06667;
	echo var_dump($v*100000)."\n";
	echo var_dump(round($v*100000,0));
	echo "\nIs equal ? "; 
	echo  ($v*100000==round($v*100000,0)) ? "true" : "false";

1 thought on “Floating point values”

Leave a Reply

Your email address will not be published. Required fields are marked *