Class XHalf
Extension methods and other bonus stuff for Half.
Inheritance
System.Object
XHalf
Namespace: Galaxon.Core.Numbers
Assembly: Galaxon.Core.dll
Syntax
public static class XHalf : object
Fields
MaxExp
The maximum binary exponent supported by the type.
Declaration
public const short MaxExp = null
Field Value
| Type | Description |
|---|---|
| System.Int16 |
MinExp
The minimum binary exponent supported by the type.
Declaration
public const short MinExp = null
Field Value
| Type | Description |
|---|---|
| System.Int16 |
NumExpBits
The number of bits in the exponent.
Declaration
public const byte NumExpBits = null
Field Value
| Type | Description |
|---|---|
| System.Byte |
NumFracBits
The number of bits in the fraction.
Declaration
public const byte NumFracBits = null
Field Value
| Type | Description |
|---|---|
| System.Byte |
Properties
MaxPosSubnormalValue
The maximum positive subnormal value.
Declaration
public static Half MaxPosSubnormalValue { get; }
Property Value
| Type | Description |
|---|---|
| Half |
MinPosNormalValue
The minimum positive normal value.
Declaration
public static Half MinPosNormalValue { get; }
Property Value
| Type | Description |
|---|---|
| Half |
Methods
Assemble(Byte, UInt16, UInt64)
Assemble a new Half from parts.
Declaration
public static Half Assemble(byte signBit, ushort expBits, ulong fracBits)
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 |
|---|---|
| Half | The new Half. |
Disassemble(Half)
Disassemble the Half into its bitwise components.
Declaration
public static (byte signBit, ushort expBits, ulong fracBits) Disassemble(this Half x)
Parameters
| Type | Name | Description |
|---|---|---|
| Half | x |
Returns
| Type | Description |
|---|---|
| System.ValueTuple<System.Byte, System.UInt16, System.UInt64> |
GetRandom()
Get a random Half.
Declaration
public static Half GetRandom()
Returns
| Type | Description |
|---|---|
| Half |