I want to check the given right hand side equation is equal to the left hand side or not. The value of $x = (19/30).
(((6*($x)) - 5)/(7 - (3*($x)))) = ((4 - (8 * $x))/((4 * $x) + 2))
I had tried below mentioned code, but it shown the RHS value is greater than LHS.
<?php
function check($m, $n)
{
$rhs = abs($m);
$lhs = abs($n);
if($rhs > $lhs){
echo "$m <strong style='color:red;'>is greater than</strong> $n";
}
elseif($rhs < $lhs) {
echo "$m <strong style='color:blue;'>is smaller than</strong> $n";
}
else{
echo "$m <strong style='color:green;'>is equal</strong> $n";
}
}
// $m = ((6*(19/30)) - 5)/(7 - (3*(19/30)));
// $n = (4 - (8 * (19/30)))/((4 * (19/30)) + 2);
$x = 19/30;
$m = abs(((6*($x)) - 5)/(7 - (3*($x))));
$n = abs((4 - (8 * $x))/((4 * $x) + 2));
check($m, $n);
?>
The output:
0.23529411764706 is greater than 0.23529411764706