Compare Two Float Number using PHP

How to Expose and Route to a Resource?
How to Expose and Route to a Resource?

Problem:- Compare Two Float Number using PHP. If you want to check whether two floating number are equal or not.

Solution – Compare Two Float Number using PHP

<?php
$delta = 0.0001;
$a= 1.00001;
$b = 1.00000;
if(abs($a-$b) < $delta){
	echo "$a & $b are equal enough";
}
?>

इसे भी पढ़े – Peanut Butter खाने के Benefits और Side Effect

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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