Big Float Class
Definition
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
[SerializableAttribute]
public class BigFloat : IComparable, IFormattable,
IEquatable<BigFloat>, IComparable<BigFloat>
- Inheritance
- Object → BigFloat
- Implements
- IComparable, IComparable<BigFloat>, IEquatable<BigFloat>, IFormattable
Remarks
Use the BigFloat class to represent numbers that may not fit into the standard single or double precision floating point types, or the decimal type.
A BigFloat can have a precision of up to 236 bits. The binary exponent is an integer, which allows a decimal exponent up to roughly 646 million. This gives the BigFloat type a total range of roughly
BigFloat numbers can be constructed in a variety of ways, including from other numerical types and from strings. Implicit (widening) conversions are available for all built-in integer types and floating-point types. Explicit conversions are also available for Decimal and BigRational.
The BigFloat class provides methods for all the common operations on real numbers. Overloaded versions of the major arithmetic operators are provided for languages that support them. For languages that don't support operator overloading, equivalent static methods are supplied.
The precision of the result of an operation depends on the operation itself. Addition and subtraction by default use the smallest absolute precision of their operands. Multiplication and division use the smallest relative precision of their operands. Details on the precision of specific operations can be found in the documentation.
Results are rounded to the nearest number. There is a high probability but no guarantee that the result is correctly rounded.
The desired precision and rounding mode can be overridden by passing additional arguments to the method that performs the operation. An AccuracyGoal value specifies the precision. The precision can be absolute or relative. By default, the precision is inherited from the operands. The RoundingMode determines how the result is rounded.
The BigFloat type supports generic arithmetic. The associated arithmetic type implements IIeeeOperations<T>, which means it supports all methods available for Double in the Math class, as well as special values such as PositiveInfinity, NegativeInfinity and NaN.
Constructors
Big | Constructs a new arbitrary precision floating-point number from a BigInteger. |
Big | Constructs a new arbitrary precision floating-point number from a rational number. |
Big | Constructs a new arbitrary precision floating-point number from a double-precision floating-point number. |
Big | Constructs a new arbitrary precision floating-point number from an integer. |
Big | Constructs a new arbitrary precision floating-point number from an integer. |
Big | Constructs a new arbitrary precision floating-point number from a double-precision floating-point number. |
Big | Constructs a new arbitrary precision floating-point number from an integer. |
Big | Constructs a new arbitrary precision floating-point number from an integer. |
Big | Constructs a new arbitrary precision floating-point number from a BigInteger. |
Big | Constructs a new arbitrary precision floating-point number from a rational number. |
Big | Constructs a new arbitrary precision floating-point number from the specified sign, mantissa, and exponent. |
Properties
Absolute | Gets the number of stored bits in the fractional part of the number. |
Binary | Gets the number of bits of precision used to store the number. |
Default | Gets or sets the default accuracy goal when performing operations on existing BigFloat numbers. |
Default | Gets or sets the default rounding mode. |
Exponent | Gets the exponent part of the BigFloat value. |
Initial | Gets or sets the default accuracy goal when constructing new BigFloat numbers. |
IsInteger | Checks if the value of a BigFloat value is an integer. |
IsNegative | Checks if the value of a BigFloat value is negative zero. |
IsOne | Checks if the value of a BigFloat value is equal to one. |
IsZero | Checks if the value of a BigFloat value is zero. |
Mantissa | Gets the mantissa part of the BigFloat value. |
Sign | Gets the sign of the BigFloat value. |
Methods
Abs | Returns the absolute value of a number. |
Acos( | Returns the inverse cosine of a number. |
Acos( | Returns the inverse cosine of a number with the specified accuracy. |
Acos( | Returns the inverse cosine of a number with the specified accuracy. |
Acosh( | Returns the inverse hyperbolic cosine of a number. |
Acosh( | Returns the inverse hyperbolic cosine of a number with the specified accuracy. |
Acosh( | Returns the inverse hyperbolic cosine of a number with the specified accuracy. |
Add( | Adds two BigFloat numbers. |
Add( | Adds two numbers and returns the result with the specified accuracy. |
Add( | Adds two numbers and returns the result with the specified accuracy. |
Asin( | Returns the inverse sine of a number. |
Asin( | Returns the inverse sine of a number with the specified accuracy. |
Asin( | Returns the inverse sine of a number with the specified accuracy. |
Asinh( | Returns the inverse hyperbolic sine of a number. |
Asinh( | Returns the inverse hyperbolic sine of a number with the specified accuracy. |
Asinh( | Returns the inverse hyperbolic sine of a number with the specified accuracy. |
Atan( | Returns the inverse tangent of a number. |
Atan( | Returns the inverse tangent of a number with the specified accuracy. |
Atan( | Returns the inverse tangent of a number with the specified accuracy. |
Atan2( | Returns the inverse tangent of a number. |
Atan2( | Returns the inverse tangent of a number with the specified accuracy. |
Atan2( | Returns the inverse tangent of a number with the specified accuracy. |
Atanh( | Returns the inverse hyperbolic tangent of a number. |
Atanh( | Returns the inverse hyperbolic tangent of a number with the specified accuracy. |
Atanh( | Returns the inverse hyperbolic tangent of a number with the specified accuracy. |
Ceiling | Rounds a number up to the nearest integer. |
Compare | Compares two BigFloat numbers up to the specified AccuracyGoal. |
Compare | Compares a number to another number. |
Compare | Compares a number to another number up to the specified AccuracyGoal. |
Copy | Copies the sign of a number to another number. |
Cos( | Returns the cosine of an angle. |
Cos( | Returns the cosine of an angle with the specified accuracy. |
Cos( | Returns the cosine of an angle with the specified accuracy. |
Cosh( | Returns the hyperbolic cosine of a number. |
Cosh( | Returns the hyperbolic cosine of a number with the specified accuracy. |
Cosh( | Returns the hyperbolic cosine of a number with the specified accuracy. |
Divide( | Divides one BigFloat by another. |
Divide( | Divides one BigFloat by another to the specified accuracy. |
Equals( | Tests whether a number equals another number. |
Equals( |
Returns a value indicating whether this instance is equal to a specified object.
(Overrides Object.Equals(Object)) |
Equals( | Tests whether a number equals another number up to the specified AccuracyGoal. |
Equals( | Tests whether a number equals another number up to the specified AccuracyGoal. |
Exp( | Returns e raised to the specified power. |
Exp( | Returns e raised to the specified power to the specified accuracy. |
Exp( | Returns e raised to the specified power to the specified accuracy. |
Expm1 | Returns e raised to the specified power to the specified accuracy. |
Extend | Returns a BigFloat value with at least the specified precision and the same value as this instance. |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
Floor | Rounds a number down to the nearest integer. |
Fractional | Returns the fractional part of the BigFloat number. |
From | Constructs a new arbitrary precision floating-point number from a rational number. |
Gamma( | Returns the gamma function of a number. |
Gamma( | Returns the gamma function of a number to the specified accuracy. |
Gamma( | Returns the gamma function of a number to the specified accuracy. |
Get | Gets the approximate number of decimal digits in the BigFloat value. |
Get |
Returns the hash code for this instance.
(Overrides Object.GetHashCode()) |
Get | Returns the value of pi to the specified number of digits. |
Get | Returns the value of pi to the specified number of digits. |
Get | Gets the Type of the current instance. (Inherited from Object) |
Inverse( | Returns the reciprocal of a number. |
Inverse( | Returns the reciprocal of a number with the specified accuracy. |
Inverse( | Returns the reciprocal of a number with the specified accuracy. |
IsInfinity | Checks if the value of a BigFloat value is infinite. |
IsNa | Checks if the value of a BigFloat value is "Not a Number." |
IsNegative | Checks if the value of a BigFloat value is negative infinity. |
IsPositive | Checks if the value of a BigFloat value is positive infinity. |
Log( | Returns the natural logarithm of a number with the specified accuracy. |
Log( | Returns the natural logarithm of a number with the specified accuracy. |
Log( | Returns the logarithm of a number relative to the specified base with the specified accuracy. |
Log( | Returns the natural logarithm of a number with the specified accuracy. |
Log( | Returns the logarithm of a number relative to the specified base with the specified accuracy. |
Log( | Returns the logarithm of a number relative to the specified base with the specified accuracy. |
Log1Plus | Returns the natural logarithm of 1 plus a number with the default accuracy. |
Log1Plus | Returns the natural logarithm of 1 plus a number with the specified accuracy. |
Log1Plus | Returns the natural logarithm of 1 plus a number with the specified accuracy. |
Memberwise | Creates a shallow copy of the current Object. (Inherited from Object) |
Modulus | Returns the remainder after dividing one BigFloat number by another. |
Multiply( | Multiplies two numbers. |
Multiply( | Multiplies two numbers and returns the result to the specified accuracy. |
Negate | Returns a BigFloat value with the opposite sign. |
Parse( | Converts a string value to a BigFloat. |
Parse( | Converts a string value to a BigFloat. |
Parse( | Converts a string value to a BigFloat. |
Parse( | Converts a string value to a BigFloat. |
Parse( | Converts a string value to a BigFloat. |
Parse( | Converts a string value to a BigFloat. |
Parse( | Converts a string value to a BigFloat. |
Parse( | Converts a string value to a BigFloat. |
Pow( | Raises a number to the specified power. |
Pow( | Raises a number to the specified power. |
Pow( | Raises a number to the specified power with the specified accuracy. |
Pow( | Raises a number to the specified power with the specified accuracy. |
Pow( | Raises a number to the specified power with the specified accuracy. |
Pow( | Raises a number to the specified power with the specified accuracy. |
Restrict | Returns a BigFloat value with at most the specified precision and the same value as this instance. |
Root( | Returns the square root of a number. |
Root( | Returns the specified root of a number with the specified accuracy. |
Root( | Returns the specified root of a number with the specified accuracy. |
Round( | Rounds a BigFloat value to the nearest integer. |
Round( | Rounds a BigFloat value to the specified number of decimal digits. |
Round( | Rounds a BigFloat value to the specified number of decimal digits. |
Scale | Multiplies a BigFloat value by a power of two. |
Sin( | Returns the sine of an angle. |
Sin( | Returns the sine of an angle with the specified accuracy. |
Sin( | Returns the sine of an angle with the specified accuracy. |
Sin | Calculates the sine and the cosine of an angle. |
Sin | Calculates the sine and the cosine of an angle with the specified accuracy. |
Sin | Calculates the sine and the cosine of an angle with the specified accuracy. |
Sin | Calculates the sine and the cosine of an angle. |
Sin | Calculates the sine and the cosine of an angle with the specified accuracy. |
Sin | Calculates the sine and the cosine of an angle with the specified accuracy. |
Sinh( | Returns the hyperbolic sine of a number. |
Sinh( | Returns the hyperbolic sine of a number with the specified accuracy. |
Sinh( | Returns the hyperbolic sine of a number with the specified accuracy. |
Sqrt( | Returns the square root of a number. |
Sqrt( | Returns the square root of a number with the specified accuracy. |
Sqrt( | Returns the square root of a number with the specified accuracy. |
Subtract( | Subtracts one number from another. |
Subtract( | Subtracts one number from another and returns the result to the specified accuracy. |
Tan( | Returns the tangent of an angle. |
Tan( | Returns the tangent of an angle with the specified accuracy. |
Tan( | Returns the tangent of an angle with the specified accuracy. |
Tanh( | Returns the hyperbolic tangent of a number. |
Tanh( | Returns the hyperbolic tangent of a number with the specified accuracy. |
Tanh( | Returns the hyperbolic tangent of a number with the specified accuracy. |
ToString() |
Returns a String representation of the number.
(Overrides Object.ToString()) |
ToString( | Formats the value of the current instance using the specified format. |
ToString( | Formats the value of the current instance using the specified format. |
ToString( | Formats the value of the current instance using the specified format. |
Try | Attempts to convert a string value to a BigFloat. |
Try | Attempts to convert a string value to a BigFloat. |
Try | Attempts to convert a string value to a BigFloat. |
Operators
Addition( | Adds two BigFloat numbers. |
Addition( | Adds a BigFloat number and a BigInteger. |
Addition( | Adds a BigFloat and a BigRational number. |
Addition( | Adds two BigFloat numbers. |
Addition( | Adds a BigFloat number and a BigInteger. |
Addition( | Adds a BigFloat and a BigRational number. |
Addition( | Adds two BigFloat numbers. |
Division( | Divides one BigFloat by another. |
Division( | Divides two numbers. |
Equality( | Returns whether a BigFloat is equal to another. |
Explicit(BigFloat to BigInteger) | Converts a BigFloat to a BigInteger. |
Explicit(BigFloat to Quad) | Converts a BigFloat value to a Double. |
Explicit(BigFloat to Byte) | Converts a BigFloat to a Byte value. |
Explicit(BigFloat to Decimal) | Converts a BigFloat to a Decimal number. |
Explicit(BigFloat to Double) | Converts a BigFloat value to a Double. |
Explicit(BigFloat to Int16) | Converts a BigFloat to a Int16 value. |
Explicit(BigFloat to Int32) | Converts a BigFloat to a Int32 value. |
Explicit(BigFloat to Int64) | Converts a BigFloat to a long integer. |
Explicit(BigFloat to SByte) | Converts a BigFloat to a SByte value. |
Explicit(BigFloat to Single) | Converts a BigFloat to a single-precision floating-point number. |
Explicit(BigFloat to UInt16) | Converts a BigFloat to a UInt16 value. |
Explicit(BigFloat to UInt32) | Converts a BigFloat to an unsigned integer. |
Explicit(BigFloat to UInt64) | Converts a BigFloat to a long unsigned integer. |
Exponent( | Represents the exponentiation operator. |
Exponent( | Represents the exponentiation operator. |
Exponentiation( | Represents the exponentiation operator. |
Exponentiation( | Represents the exponentiation operator. |
Greater | Returns whether a BigFloat is greater than another. |
Greater | Returns whether a BigFloat is greater than or equal to another. |
Implicit(BigInteger to BigFloat) | Converts a BigInteger to a BigFloat value. |
Implicit(Byte to BigFloat) | Converts a BigInteger value to a Byte value. |
Implicit(Decimal to BigFloat) | Converts a Decimal number to a BigFloat value. |
Implicit(Double to BigFloat) | Converts a double-precision floating-point number to a BigInteger value. |
Implicit(Int16 to BigFloat) | Converts a 16 bit signed integer to a BigFloat value. |
Implicit(Int32 to BigFloat) | Converts a 32 bit signed integer to a BigFloat value. |
Implicit(Int64 to BigFloat) | Converts a 64 bit signed integer to a BigFloat value. |
Implicit(SByte to BigFloat) | Converts a signed byte to a BigFloat value. |
Implicit(Single to BigFloat) | Converts a single-precision floating-point number to a BigInteger value. |
Implicit(UInt16 to BigFloat) | Converts a 16 bit unsigned integer to a BigFloat value. |
Implicit(UInt32 to BigFloat) | Converts a 32 bit unsigned integer to a BigFloat value. |
Implicit(UInt64 to BigFloat) | Converts a 64 bit unsigned integer to a BigFloat value. |
Inequality( | Returns whether a BigFloat is not equal to another. |
Less | Returns whether a BigFloat is less than another. |
Less | Returns whether a BigFloat is less than or equal to another. |
Modulus( | Returns the remainder after dividing one BigFloat number by another. |
Multiply( | Multiplies two numbers. |
Multiply( | Multiplies two numbers. |
Multiply( | Multiplies two numbers. |
Multiply( | Multiplies a BigFloat value by an integer. |
Subtraction( | Subtracts one number from another. |
Subtraction( | Adds two BigFloat numbers. |
Subtraction( | Adds two BigFloat numbers. |
Unary | Returns a BigInteger value with the opposite sign. |
Fields
Max | The largest possible BigFloat, |
Min | The smallest BigFloat greater than zero, |
Minus | The number -1 as a BigFloat, |
Min | The smallest possible BigFloat, |
NaN | Not-a-Number, the value returned when the result is undefined. |
Negative | Negative infinity as a BigFloat, |
Negative | Negative 0 as a BigFloat, |
One | The number 1 as a BigFloat, |
Positive | Positive infinity as a BigFloat, |
Zero | The number 0 as a BigFloat, |