Пример #1
0
 public static bool IsPositiveInfinity(Half half)
 {
     return(half.value == 0x7c00);
 }
Пример #2
0
 public static bool IsNegativeInfinity(Half half)
 {
     return(half.value == 0xfc00);
 }
Пример #3
0
 public static bool IsInfinity(Half half)
 {
     return((half.value & 0x7fff) == 0x7c00);
 }
Пример #4
0
 public static bool IsNaN(Half half)
 {
     return((half.value & 0x7fff) > 0x7c00);
 }
Пример #5
0
 public static Half Abs(Half half)
 {
     return(Half.ToHalf((ushort)(half.value & 0x7fff)));
 }
Пример #6
0
 public static Half Negate(Half half)
 {
     return(Half.ToHalf((ushort)(half.value ^ 0x8000)));
 }
Пример #7
0
        public static unsafe float HalfToSingle(Half half)
        {
            uint result = mantissaTable[offsetTable[half.value >> 10] + (half.value & 0x3ff)] + exponentTable[half.value >> 10];

            return(*((float *)&result));
        }