mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-10 15:57:26 +00:00
Fix a bug in single->half conversion.
The original C code had if(m & 0x00800000) which is true if the expresssion does not evaluate to zero. This was inncorretly translated to the C# code if((m & 0x00800000) == 1) which only evaluates true if the expression evalaute to 1, which it never does. The correct test is to test not equal to zero (!= 0).
This commit is contained in:
parent
2a97192ef8
commit
5481aa7097
|
@ -228,7 +228,7 @@ namespace OpenTK
|
||||||
|
|
||||||
mantissa = mantissa + 0x00000fff + ((mantissa >> 13) & 1);
|
mantissa = mantissa + 0x00000fff + ((mantissa >> 13) & 1);
|
||||||
|
|
||||||
if ((mantissa & 0x00800000) == 1)
|
if ((mantissa & 0x00800000) != 0)
|
||||||
{
|
{
|
||||||
mantissa = 0; // overflow in significand,
|
mantissa = 0; // overflow in significand,
|
||||||
exponent += 1; // adjust exponent
|
exponent += 1; // adjust exponent
|
||||||
|
|
Loading…
Reference in a new issue