FloatMath 5.46.0
Single precision helpers. PHP only has doubles, so float32 results are emulated by rounding.
Methods
fround()
php
public static function fround(float $x) : floatRounds a double to the nearest float32 value (ties to even), like Java's (float) cast or JS Math.fround(). Uses Veltkamp splitting (2^29 + 1), which is exact for every finite value in the normal float32 range and much faster than pack()/unpack(). Code generators inline the same expression.
lerp()
php
public static function lerp(float $a, float $b, float $c) : floatfloat32 lerp: fround(b + fround(a * fround(c - b)))
