BitConverter.ToDouble Method (Byte[], Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a double-precision floating point number converted from eight bytes at a specified position in a byte array.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

static member ToDouble : 
        value:byte[] *
        startIndex:int -> float

Parameters

value
Type: System.Byte[]

An array of bytes.

startIndex
Type: System.Int32

The starting position within value.

Return Value

Type: System.Double

A double precision floating point number formed by eight bytes beginning at startIndex.

Exception Condition
ArgumentException

startIndex is greater than or equal to the length of value minus 7, and is less than or equal to the length of value minus 1.

ArgumentNullException

value is null.

ArgumentOutOfRangeException

startIndex is less than zero or greater than the length of value minus 1.

The ToDouble method converts the bytes from index startIndex to startIndex + 7 to a Double value. The order of bytes in the array must reflect the endianness of the computer system's architecture; for more information, see the Remarks section of the BitConverter class topic.

The following code example converts elements of Byte arrays to Double values with the ToDouble method.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: