It is undefined behavior for both floats that are too large to represent, and for negative ones. We should instead do a proper truncate.
WHLSL is no longer relevant.