Class XFloatingPoint
Extension methods for IFloatingPoint{T}.
Inheritance
System.Object
XFloatingPoint
Assembly: Galaxon.Core.dll
Syntax
public static class XFloatingPoint : object
Methods
Assemble<T>(Byte, UInt16, UInt64)
Assemble a new floating point value from parts.
Declaration
public static T Assemble<T>(byte signBit, ushort expBits, ulong fracBits)
where T : IFloatingPoint<T>
Parameters
| Type |
Name |
Description |
| System.Byte |
signBit |
The sign bit (1 or 0).
|
| System.UInt16 |
expBits |
The exponent bits.
|
| System.UInt64 |
fracBits |
The fraction bits.
|
Returns
| Type |
Description |
| T |
The new floating point value.
|
Type Parameters
| Name |
Description |
| T |
A floating point type.
|
Disassemble<T>(T)
Disassemble the floating point value into its bitwise components.
Declaration
public static (byte signBit, ushort expBits, ulong fracBits) Disassemble<T>(this T x)
where T : IFloatingPoint<T>
Parameters
| Type |
Name |
Description |
| T |
x |
|
Returns
| Type |
Description |
| System.ValueTuple<System.Byte, System.UInt16, System.UInt64> |
|
Type Parameters
GetMaxExp<T>()
Get the maximum exponent for the type.
Declaration
public static short GetMaxExp<T>()
where T : IFloatingPoint<T>
Returns
| Type |
Description |
| System.Int16 |
|
Type Parameters
GetMinExp<T>()
Get the minimum exponent for the type.
Declaration
public static short GetMinExp<T>()
where T : IFloatingPoint<T>
Returns
| Type |
Description |
| System.Int16 |
|
Type Parameters
GetMinPosNormalValue<T>()
Get the minimum positive normal value for the type.
Declaration
public static T GetMinPosNormalValue<T>()
where T : IFloatingPoint<T>
Returns
Type Parameters
GetNumExpBits<T>()
Get the number of exponent bits.
Declaration
public static byte GetNumExpBits<T>()
where T : IFloatingPoint<T>
Returns
| Type |
Description |
| System.Byte |
|
Type Parameters
GetNumFracBits<T>()
Get the number of fraction bits.
Declaration
public static byte GetNumFracBits<T>()
where T : IFloatingPoint<T>
Returns
| Type |
Description |
| System.Byte |
|
Type Parameters