C# BitConverter GetBytes(Double)
Description
BitConverter GetBytes(Double)
returns the specified
double-precision floating point value as an array of bytes.
Syntax
BitConverter.GetBytes(Double)
has the following syntax.
public static byte[] GetBytes(
double value
)
Parameters
BitConverter.GetBytes(Double)
has the following parameters.
value
- The number to convert.
Returns
BitConverter.GetBytes(Double)
method returns
Example
The following code example converts the bit patterns of Double values to Byte arrays with the GetBytes method.
/* ww w . j a v a 2 s .c om*/
using System;
class GetBytesUInt64Demo
{
public static void Main( )
{
byte[ ] byteArray = BitConverter.GetBytes( (Double)1000 );
Console.WriteLine(BitConverter.ToString( byteArray ) );
}
}
The code above generates the following result.