Mega Code Archive

 
Categories / VB.Net / Development
 

BitConverter ToDouble returns a double converted from eight bytes at a specified position in a byte array

Imports System Imports Microsoft.VisualBasic Module BytesToDoubleDemo     Sub BAToDouble( bytes( ) As Byte, index As Integer )         Dim value As Double = BitConverter.ToDouble( bytes, index )         Console.WriteLine( value )     End Sub      Sub Main( )         Dim byteArray as Byte( ) = { _               0,   0,   0,   0,   0,   0,   0,   0, 240,  63, _               0,   0,   0,   0,   0, 224, 111,  64,   0,   0, _               0,   0,   0,   0,   0, 248, 255,   0,   0,   0, _               0,   0,   0, 240, 255,   0,   0,   0,   0,   0, _               0, 240, 127 }         BAToDouble( byteArray, 0 )     End Sub  End Module