예제 #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));
        }