Class DoubleExtensions
IO-related extension methods for
Inheritance
Namespace: X10D.IO
Assembly: X10D.dll
Syntax
public static class DoubleExtensions : object
Methods
| Improve this Doc View SourceGetBigEndianBytes(Double)
Converts the current double-precision floating-point number into an array of bytes, as little endian.
Declaration
public static byte[] GetBigEndianBytes(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The |
Returns
Type | Description |
---|---|
System.Byte[] | An array of bytes with length 4. |
GetLittleEndianBytes(Double)
Converts the current double-precision floating-point number into an array of bytes, as little endian.
Declaration
public static byte[] GetLittleEndianBytes(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The |
Returns
Type | Description |
---|---|
System.Byte[] | An array of bytes with length 4. |
TryWriteBigEndianBytes(Double, Span<Byte>)
Converts the current double-precision floating-point number into a span of bytes, as big endian.
Declaration
public static bool TryWriteBigEndianBytes(this double value, Span<byte> destination)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The |
Span<System.Byte> | destination | The span of bytes where the value is to be written, as big endian. |
Returns
Type | Description |
---|---|
System.Boolean | true if the conversion was successful; otherwise, false. |
TryWriteLittleEndianBytes(Double, Span<Byte>)
Converts the current double-precision floating-point number into a span of bytes, as little endian.
Declaration
public static bool TryWriteLittleEndianBytes(this double value, Span<byte> destination)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The |
Span<System.Byte> | destination | The span of bytes where the value is to be written, as little endian. |
Returns
Type | Description |
---|---|
System.Boolean | true if the conversion was successful; otherwise, false. |