Big Rational Structure
Represents an arbitrary rational number.
Definition
Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
[SerializableAttribute]
public readonly struct BigRational : IComparable,
IFormattable, IEquatable<BigRational>, IComparable<BigRational>,
IComparable<BigInteger>, IComparable<int>
- Implements
- IComparable, IComparable<BigRational>, IComparable<BigInteger>, IComparable<Int32>, IEquatable<BigRational>, IFormattable
Remarks
Use the BigRational class to represent a fraction of integers of arbitrary precision. BigRational objects are immutable.
The Numerator and Denominator return the parts of the fraction. The numerator and the denominator have no common divisors. The denominator is always positive. Zero is represented as 0 / 1.
Constructors
Big | Constructs a new BigInteger from two arbitrary precision integers. |
Big | Constructs a new BigRational from an arbitrary precision numerator and denominator. |
Big | Constructs a new BigRational from an integer numerator and denominator. |
Properties
Denominator | Gets the denominator of the rational number. |
IsOne | Gets whether the rational number is equal to one. |
IsZero | Gets whether the rational number is equal to zero. |
Numerator | Gets the numerator of the rational number. |
Sign | Gets the sign of the rational number. |
Methods
Abs | Returns the absolute value of a rational number. |
Add | Adds two rational numbers. |
Ceiling | Rounds a rational number up to the nearest integer. |
Compare | Compares this instance to a specified rational number and returns an indication of their relative values. |
Compare | Compares this instance to a specified rational number and returns an indication of their relative values. |
Compare | Compares this instance to a specified rational number and returns an indication of their relative values. |
Deconstruct | Deconstructs a rational number into its numerator and denominator. |
Divide | Divides a rational number by another and returns the result. |
Equals( | Returns whether two rational numbers represent the same value. |
Equals( |
Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueType.Equals(Object)) |
Floor | Rounds a rational number down to the nearest integer. |
Get |
Returns the hash code for this instance.
(Overrides ValueType.GetHashCode()) |
Get | Gets the Type of the current instance. (Inherited from Object) |
Max | Returns the largest of two rational numbers. |
Min | Returns the smallest of two rational numbers. |
Multiply( | Multiplies a rational number by an arbitrary precision integer. |
Multiply( | Multiplies a rational number by an arbitrary precision integer. |
Multiply( | Multiplies two rational numbers. |
Multiply( | Multiplies a rational number by an integer. |
Multiply( | Multiplies a rational number by an integer. |
Negate | Negates a rational number from another and returns the result. |
Pow | Raises a BigRational to an integer power. |
Round | Rounds a rational number to the specified number of decimal digits. |
Subtract | Subtracts a rational number from another and returns the result. |
ToString() |
Returns a string representation of the rational number.
(Overrides ValueType.ToString()) |
ToString( | Returns a string representation of a rational number. |
Operators
Addition( | Adds a big integer and a rational number. |
Addition( | Adds a big integer and a rational number. |
Addition( | Adds two rational numbers. |
Addition( | Adds an integer and a rational number. |
Addition( | Adds an integer and a rational number. |
Division( | Divides a rational number by an arbitrary precision integer. |
Division( | Divides a rational number by another and returns the result. |
Division( | Divides a rational number by an arbitrary precision integer. |
Equality( | Determines if a rational number is equal to another and returns the result. |
Equality( | Determines if a rational number is equal to another and returns the result. |
Equality( | Determines if a rational number is equal to another and returns the result. |
Explicit(BigRational to BigInteger) | Converts a BigRational to a BigInteger number. |
Explicit(BigRational to Byte) | Converts a BigRational to a Byte value. |
Explicit(BigRational to Decimal) | Converts a BigRational to a Decimal number. |
Explicit(BigRational to Double) | Converts a BigRational to a double-precision floating-point number. |
Explicit(BigRational to Int16) | Converts a BigRational to a Int16 value. |
Explicit(BigRational to Int32) | Converts a BigRational to a Int32 value. |
Explicit(BigRational to Int64) | Converts a BigRational to a long integer. |
Explicit(BigRational to SByte) | Converts a BigRational to a SByte value. |
Explicit(BigRational to Single) | Converts a BigRational to a single-precision floating-point number. |
Explicit(BigRational to UInt16) | Converts a BigRational to a UInt16 value. |
Explicit(BigRational to UInt32) | Converts a BigRational to an unsigned integer. |
Explicit(BigRational to UInt64) | Converts a BigRational to a long unsigned integer. |
Explicit(Decimal to BigRational) | Converts a Decimal number to a BigInteger value. |
Explicit(Double to BigRational) | Converts a double-precision floating-point number to a BigInteger value. |
Explicit(Single to BigRational) | Converts a single-precision floating-point number to a BigInteger value. |
Exponent( | Represents the exponentiation operator. |
Exponentiation( | Represents the exponentiation operator. |
Greater | Determines if a rational number is greater than another and returns the result. |
Greater | Determines if a rational number is greater than another and returns the result. |
Greater | Determines if a rational number is greater than another and returns the result. |
Greater | Determines if a rational number is greater than or equal to another and returns the result. |
Greater | Determines if a rational number is greater than or equal to another and returns the result. |
Greater | Determines if a rational number is greater than or equal to another and returns the result. |
Implicit(BigInteger to BigRational) | Converts a BigInteger value to a BigRational value. |
Implicit(Byte to BigRational) | Converts a Byte value to a BigRational value. |
Implicit(Int16 to BigRational) | Converts a 16 bit signed integer to a BigRational value. |
Implicit(Int32 to BigRational) | Converts a 32 bit signed integer to a BigRational value. |
Implicit(Int64 to BigRational) | Converts a 64 bit signed integer to a BigRational value. |
Implicit(SByte to BigRational) | Converts a SByte value to a BigRational value. |
Implicit(UInt16 to BigRational) | Converts a 16 bit unsigned integer to a BigRational value. |
Implicit(UInt32 to BigRational) | Converts a 32 bit unsigned integer to a BigRational value. |
Implicit(UInt64 to BigRational) | Converts a 64 bit unsigned integer to a BigRational value. |
Inequality( | Determines if a rational number is not equal to another and returns the result. |
Inequality( | Determines if a rational number is not equal to another and returns the result. |
Inequality( | Determines if a rational number is not equal to another and returns the result. |
Less | Determines if a rational number is less than another and returns the result. |
Less | Determines if a rational number is less than another and returns the result. |
Less | Determines if a rational number is less than another and returns the result. |
Less | Determines if a rational number is less than or equal to another and returns the result. |
Less | Determines if a rational number is less than or equal to another and returns the result. |
Less | Determines if a rational number is less than or equal to another and returns the result. |
Multiply( | Multiplies a rational number by an arbitrary precision integer. |
Multiply( | Multiplies a rational number by an arbitrary precision integer. |
Multiply( | Multiplies two rational numbers. |
Multiply( | Multiplies a rational number by an integer. |
Multiply( | Multiplies a rational number by an integer. |
Subtraction( | Subtracts a rational number from a big integer. |
Subtraction( | Subtracts a big integer from a rational number. |
Subtraction( | Subtracts a rational number from another and returns the result. |
Subtraction( | Subtracts an integer from a rational number. |
Subtraction( | Subtracts a rational number from an integer. |
Unary | Negates a rational number from another and returns the result. |
Fields
Max | The largest possible rational number. |
Minus | The number 1 as a rational number. |
Min | The smallest possible rational number. |
One | The number 1 as a rational number. |
Zero | The number 0 as a rational number. |