How to define that float is half of the number? <p>What would be the most efficient way to say that float value is half of integer for example 0.5, 1.5, 10.5?</p> <p>First what coming on my mind is:</p> <pre><code>$is_half = (($number - floor($number)) === 0.5); </code></pre> <p>Is there any better solutions?</p>