Given the variables below, why does the elseif
conditional get hit?
$i = 0;
$rating = 11.11111111111;
$scale_step = 11.11111111111;
if( $rating == $i * $scale_step )
{
return 'checked';
}
elseif( $rating < (($i + 1) * $scale_step)
&& $rating > $i * $scale_step )
{
return 'checked';
}
else
{
return '';
}
In the elseif
above, $rating
is equal to ($i + 1) * $scale_step
- it is NOT less than. So why does it evaluate to true?