I'm running into a bizarre issue where PHP is returning "true" for 20.0 < 20.0 Here is the code I am running:
$measurement = (float) 34.8;
$mean = (float) 29;
$percent_tolerance = (float) 20;
$percent_deviation = (abs($measurement - $mean) / $mean) * 100;
$within_tolerance = $percent_deviation < $percent_tolerance;
// Outputs: 20.0, 20.0, true
dd($percent_tolerance, $percent_deviation, $within_tolerance);
Here is a Wolfram Alpha output of the logic on the $percent_deviation variable: https://www.wolframalpha.com/input?i=%28abs%2834.8+-+29%29+%2F+29%29+*+100
I am running PHP 7.4.9.
I don't know what else to say other than I'm very perplexed. Thanks!