func fracFrom23BitsTo10(float32Bits uint32) uint32 { const ( expAll = (1<<8 - 1) << 23 expInfNaN = expAll fracAll = 1<<23 - 1 fracInf = 0 fracLoBit = 1 << 13 fracHalf = fracLoBit >> 1 fracRoundUp = fracHalf - 1 | fracLoBit fracZero = fracLoBit - 1 ) switch { case float32Bits&expAll == expInfNaN: if float32Bits&fracAll == fracInf { return float32Bits } float32Bits |= fracAll case float32Bits&fracHalf != 0: case float32Bits&fracRoundUp != 0: float32Bits += fracLoBit } return float32Bits &^ fracZero }
To receive a hint, submit unfixed code.