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
1 changed files with 1 additions and 1 deletions
|
@ -228,7 +228,7 @@ namespace OpenTK
|
|||
|
||||
mantissa = mantissa + 0x00000fff + ((mantissa >> 13) & 1);
|
||||
|
||||
if ((mantissa & 0x00800000) == 1)
|
||||
if ((mantissa & 0x00800000) != 0)
|
||||
{
|
||||
mantissa = 0; // overflow in significand,
|
||||
exponent += 1; // adjust exponent
|
||||
|
|
Loading…
Reference in a new issue