System.BitConverter.Int64BitsToDouble C# (CSharp) Метод

Int64BitsToDouble() публичный статический Метод

public static Int64BitsToDouble ( long value ) : double
value long
Результат double
        public static unsafe double Int64BitsToDouble(long value) {
            return *((double *)&value);
        }                    
    }

Usage Example

Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="exp"></param>
        /// <returns></returns>
        public static double PowerOf2(int exp)
        {
            if (exp > 1023 || exp < -1022)
            {
                throw new ArgumentException("Exponent out of bounds");
            }
            long expBias = exp + ExponentBias;
            long bits    = expBias << 52;

            return(BitConverter.Int64BitsToDouble(bits));
        }
All Usage Examples Of System.BitConverter::Int64BitsToDouble