math-emu: fix floating-point to integer overflow detection