OpenTAP 9.25
API Reference
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OpenTap.BigFloat Struct Reference

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

Inherits IFormattable, IComparable, IComparable< BigFloat >, and IEquatable< BigFloat >.

Public Member Functions

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

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 One = new BigFloat(BigInteger.One, BigInteger.One)
 Big float 1.
 
static readonly BigFloat Zero = new BigFloat(BigInteger.Zero, BigInteger.One)
 Big float 0.
 
static readonly BigFloat Infinity = new BigFloat(BigInteger.One, BigInteger.Zero)
 Big float Infinity.
 
static readonly BigFloat NegativeInfinity = new BigFloat(BigInteger.MinusOne, BigInteger.Zero)
 Big float negative infinity.
 
static readonly BigFloat NaN = new BigFloat(BigInteger.Zero, BigInteger.Zero)
 Big float not a number.
 

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.25 API built Tue Aug 6 2024 07:49:23