C# BitConverter Int64BitsToDouble

Description

BitConverter Int64BitsToDouble converts the specified 64-bit signed integer to a double-precision floating point number.

Syntax

BitConverter.Int64BitsToDouble has the following syntax.


public static double Int64BitsToDouble(
  long value
)

Parameters

BitConverter.Int64BitsToDouble has the following parameters.

  • value - The number to convert.

Returns

BitConverter.Int64BitsToDouble method returns A double-precision floating point number whose value is equivalent to value.

Example

The following code example converts the bit patterns of several Int64 values to Double values with the Int64BitsToDouble method.


//from   w w  w  .  j  a v a 2 s  . co  m
using System;

class Int64BitsToDoubleDemo
{

    public static void Main( )
    {
        double doubleValue;
        doubleValue = BitConverter.Int64BitsToDouble( 0x3FF0000000000000 );

        Console.WriteLine( doubleValue );

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version