OpenTAP 9.35
API Reference
OpenTap.BigFloat Struct Reference

Arbitrary precision floating point numbers for exact numeric computations for when performance is not an issue. More...

Public Member Functions

 BigFloat (BigInteger nominator, BigInteger denominator)
 Creates a new BigFloat from fractional values.
 
BigFloat Normalize ()
 Normalizes the fraction by dividing by greates common divisor.
 
override string ToString ()
 Converts the fraction to a decimal string.
 
bool Equals (BigFloat other)
 Compares two numbers.
 
override bool Equals (object obj)
 Compares this bigfloat with another object.
 
override int GetHashCode ()
 Gets the hash code of this value.
 
int CompareTo (BigFloat other)
 Compares two numbers.
 
int CompareTo (object obj)
 Converts obj before doing comparison using CompareTo. Throws an exception if obj cannot be compared to a BigFloat.
 
string ToString (string format, IFormatProvider formatProvider)
 Converts this value to a string.
 
 BigFloat (double value)
 Creates a BigFloat.
 
double ToDouble ()
 Converts the value to the nearest double, rounding half to even, exactly like double.Parse does.
 

Static Public Member Functions

static int bitLength (BigInteger value)
 The number of bits needed to represent a non-negative BigInteger.
 

Public Attributes

BigInteger Numerator
 The numerator as an arbitrarily sized integer.
 
BigInteger Denominator
 The denominator as an arbitrarily sized integer.
 

Static Public Attributes

static readonly BigFloat Zero = new(BigInteger.Zero, BigInteger.One)
 Big float 0.
 
static readonly BigFloat Infinity = new(BigInteger.One, BigInteger.Zero)
 Big float Infinity.
 
static readonly BigFloat NegativeInfinity = new(BigInteger.MinusOne, BigInteger.Zero)
 Big float negative infinity.
 
static readonly BigFloat NaN = new(BigInteger.Zero, BigInteger.Zero)
 Big float not a number.
 
static readonly BigFloat One = new(BigInteger.One, BigInteger.One)
 Big float 1.
 
static readonly BigFloat NegativeOne = new(BigInteger.MinusOne, BigInteger.One)
 Big float -1.
 
static readonly BigFloat Half = new(BigInteger.One, 2)
 Big float 0.5.
 
static readonly BigInteger maxExactInteger = BigInteger.Pow(2, 53)
 2^53. Integers up to this are represented exactly by a double.
 

Detailed Description

Arbitrary precision floating point numbers for exact numeric computations for when performance is not an issue.

Constructor & Destructor Documentation

◆ BigFloat() [1/2]

OpenTap.BigFloat.BigFloat ( BigInteger nominator,
BigInteger denominator )
inline

Creates a new BigFloat from fractional values.

Parameters
nominator
denominator

◆ BigFloat() [2/2]

OpenTap.BigFloat.BigFloat ( double value)
inline

Creates a BigFloat.

Parameters
value

Member Function Documentation

◆ CompareTo() [1/2]

int OpenTap.BigFloat.CompareTo ( BigFloat other)
inline

Compares two numbers.

Parameters
other
Returns
-1 if other is less, 1 if other is greater and 0 if other is equal to this.

◆ CompareTo() [2/2]

int OpenTap.BigFloat.CompareTo ( object obj)
inline

Converts obj before doing comparison using CompareTo. Throws an exception if obj cannot be compared to a BigFloat.

Parameters
obj
Returns

◆ Equals() [1/2]

bool OpenTap.BigFloat.Equals ( BigFloat other)
inline

Compares two numbers.

Parameters
other
Returns
True if they are equal.

◆ Equals() [2/2]

override bool OpenTap.BigFloat.Equals ( object obj)
inline

Compares this bigfloat with another object.

Parameters
obj
Returns

◆ GetHashCode()

override int OpenTap.BigFloat.GetHashCode ( )
inline

Gets the hash code of this value.

Returns

◆ Normalize()

BigFloat OpenTap.BigFloat.Normalize ( )
inline

Normalizes the fraction by dividing by greates common divisor.

Returns
The normalized fraction.

◆ ToString() [1/2]

override string OpenTap.BigFloat.ToString ( )
inline

Converts the fraction to a decimal string.

Returns

◆ ToString() [2/2]

string OpenTap.BigFloat.ToString ( string format,
IFormatProvider formatProvider )
inline

Converts this value to a string.

Parameters
format
formatProvider
Returns

OpenTAP 9.35 API built Thu Sep 3 2026 13:51:28