public static unsafe Record_Float_Signed ll_math_frexp(double x) { Record_Float_Signed result = new Record_Float_Signed(); if (x == 0.0) // Laj: Else pw2 = -1022 { result.item0 = 0.0; result.item1 = 0; return result; } DoubleUshorts u; u.d = x; short *q = (short *)&u.u3; int i = (*q >> 4) & 0x7ff; i -= 0x3fe; result.item1 = i; unchecked { // Constant value '32783' cannot be converted to a 'short' *q &= (short)0x800f; } // Warning: Bitwise-or operator used on a sign-extended operand; // consider casting to a smaller unsigned type first *q |= 0x3fe0; result.item0 = u.d; return result; }
public static unsafe Record_Float_Signed ll_math_frexp(double x) { Record_Float_Signed result = new Record_Float_Signed(); if (x == 0.0) // Laj: Else pw2 = -1022 { result.item0 = 0.0; result.item1 = 0; return(result); } DoubleUshorts u; u.d = x; short *q = (short *)&u.u3; int i = (*q >> 4) & 0x7ff; i -= 0x3fe; result.item1 = i; unchecked { // Constant value '32783' cannot be converted to a 'short' *q &= (short)0x800f; } // Warning: Bitwise-or operator used on a sign-extended operand; // consider casting to a smaller unsigned type first *q |= 0x3fe0; result.item0 = u.d; return(result); }