Table of Contents

Class XFloat

Extension methods and other bonus stuff for float.

Inheritance
System.Object
XFloat
Namespace: Galaxon.Core.Numbers
Assembly: Galaxon.Core.dll
Syntax
public static class XFloat : object

Fields

MaxExp

The maximum binary exponent supported by the type.

Declaration
public const short MaxExp = null
Field Value
Type Description
System.Int16
| Improve this Doc View Source

MinExp

The minimum binary exponent supported by the type.

Declaration
public const short MinExp = null
Field Value
Type Description
System.Int16
| Improve this Doc View Source

NumExpBits

The number of bits in the exponent.

Declaration
public const byte NumExpBits = null
Field Value
Type Description
System.Byte
| Improve this Doc View Source

NumFracBits

The number of bits in the fraction.

Declaration
public const byte NumFracBits = null
Field Value
Type Description
System.Byte
| Improve this Doc View Source

Properties

MaxPosSubnormalValue

The maximum positive subnormal value.

Declaration
public static float MaxPosSubnormalValue { get; }
Property Value
Type Description
System.Single
| Improve this Doc View Source

MinPosNormalValue

The minimum positive normal value.

Declaration
public static float MinPosNormalValue { get; }
Property Value
Type Description
System.Single
| Improve this Doc View Source

Methods

Assemble(Byte, UInt16, UInt64)

Assemble a new float from parts.

Declaration
public static float 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
System.Single

The new float.

| Improve this Doc View Source

Disassemble(Single)

Disassemble the float into its bitwise components.

Declaration
public static (byte signBit, ushort expBits, ulong fracBits) Disassemble(this float x)
Parameters
Type Name Description
System.Single x
Returns
Type Description
System.ValueTuple<System.Byte, System.UInt16, System.UInt64>
| Improve this Doc View Source

GetRandom()

Get a random float.

Declaration
public static float GetRandom()
Returns
Type Description
System.Single
| Improve this Doc View Source
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX | Galaxy logo by Freepik