Use a union to return NaN constant from ConvertFromHalf. Refs #274

This commit is contained in:
baldurk
2016-05-29 10:32:02 +02:00
parent 9e2fa30a7e
commit 64db4e6e8e
+7 -2
View File
@@ -121,7 +121,12 @@ inline float ConvertFromHalf(uint16_t comp)
}
else // if(exponent = 0x1f)
{
int nan = 0x7F800001;
return *(float *)&nan;
union
{
int i;
float f;
} nan;
nan.i = 0x7F800001;
return nan.f;
}
}