A Real Closed Field (RCF) numeral.
RCF numerals can represent:
const { RCFNum } = Context('main');// Create piconst pi = RCFNum.pi();console.log(pi.toDecimal(10)); // "3.1415926536"// Create a rationalconst half = new RCFNum('1/2');// Arithmeticconst sum = pi.add(half);// Check propertiesconsole.log(pi.isTranscendental()); // trueconsole.log(half.isRational()); // true Copy
const { RCFNum } = Context('main');// Create piconst pi = RCFNum.pi();console.log(pi.toDecimal(10)); // "3.1415926536"// Create a rationalconst half = new RCFNum('1/2');// Arithmeticconst sum = pi.add(half);// Check propertiesconsole.log(pi.isTranscendental()); // trueconsole.log(half.isRational()); // true
Add two RCF numerals.
The RCF numeral to add
this + other
Divide two RCF numerals.
The RCF numeral to divide by
this / other
Check if this RCF numeral is equal to another.
The RCF numeral to compare with
true if this == other
Check if this RCF numeral is greater than or equal to another.
true if this >= other
Check if this RCF numeral is greater than another.
true if this > other
Compute the multiplicative inverse.
1/this
Check if this RCF numeral is an algebraic number.
true if this is algebraic
Check if this RCF numeral is an infinitesimal.
true if this is infinitesimal
Check if this RCF numeral is a rational number.
true if this is rational
Check if this RCF numeral is a transcendental number.
true if this is transcendental
Check if this RCF numeral is less than or equal to another.
true if this <= other
Check if this RCF numeral is less than another.
true if this < other
Multiply two RCF numerals.
The RCF numeral to multiply
this * other
Negate this RCF numeral.
-this
Check if this RCF numeral is not equal to another.
true if this != other
Raise this RCF numeral to a power.
The exponent
this^k
Subtract two RCF numerals.
The RCF numeral to subtract
this - other
Convert this RCF numeral to a decimal string.
Number of decimal places
Decimal string representation
Convert this RCF numeral to a string.
Optional
If true, use compact representation
String representation
A Real Closed Field (RCF) numeral.
RCF numerals can represent: