diff options
| -rw-r--r-- | bits.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -311,5 +311,14 @@ int float64_f2i(unsigned uf1, unsigned uf2) { * Difficulty: 4 */ unsigned floatPower2(int x) { - return 2; + if (x < -149) { + return 0; + } + if (x < -126) { + return 1 << (x + 149); + } + if (x <= 127) { + return (x + 127) << 23; + } + return 0x7F800000; } |
