X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=fp16.h;h=535eccf36b04c181f08cc432b3fca5785ca54da4;hp=56a5607c5886b07cb3a38af711d48087c4565ab0;hb=d7def3f9e42e72566d7aedd52ffdeb5851da8314;hpb=425d68dcbdd681ad3157000360521e8f36eb6c4c diff --git a/fp16.h b/fp16.h index 56a5607..535eccf 100644 --- a/fp16.h +++ b/fp16.h @@ -106,7 +106,7 @@ static inline fp16_int_t fp32_to_fp16(float x) unsigned int mant_odd = (f.u >> 13) & 1; // resulting mantissa is odd // update exponent, rounding bias part 1 - f.u += ((15 - 127) << 23) + 0xfff; + f.u += (unsigned(15 - 127) << 23) + 0xfff; // rounding bias part 2 f.u += mant_odd; // take the bits!