Static Member Summary
Static Public Members | ||
public static get |
0.5 |
|
public static get |
-1 |
|
public static get |
Negative Infinity. |
|
public static get |
Not a Number. |
|
public static get |
1 |
|
public static get |
Positive infinity. |
|
public static get |
10 |
|
public static get |
2 |
|
public static get |
0 |
Static Method Summary
Static Public Methods | ||
public static |
create(number: KFractionInputData): Fraction Create an entity object of this class. |
|
public static |
valueOf(number: KFractionInputData): Fraction Convert number to Fraction type. |
Constructor Summary
Public Constructor | ||
public |
constructor(number: KFractionInputData) Create an fraction. |
Member Summary
Public Members | ||
public get |
booleanValue: boolean: * boolean value. |
|
public |
denominator |
|
public get |
doubleValue: number: * floating point. |
|
public get |
integer value. |
|
public |
numerator |
Method Summary
Public Methods | ||
public |
Absolute value. |
|
public |
add(num: KFractionInputData): Fraction Add. |
|
public |
and(number: KFractionInputData): Fraction Logical AND. |
|
public |
Ceil. |
|
public |
clip(min: KFractionInputData, max: KFractionInputData): Fraction Clip number within range. |
|
public |
Deep copy. |
|
public |
compareTo(num: KFractionInputData): number Compare values. |
|
public |
div(num: KFractionInputData): Fraction Divide. |
|
public |
divide(number: KFractionInputData): Fraction Divide. |
|
public |
equals(num: KFractionInputData): boolean Equals. |
|
public |
equalsState(number: KFractionInputData): boolean Numeric type match. |
|
public |
extgcd(number: KFractionInputData): Array<Fraction> Extended Euclidean algorithm. |
|
public |
Factorization. |
|
public |
Factorial function, x!. |
|
public |
To integer rounded down to the nearest. |
|
public |
Floor. |
|
public |
Fraction. |
|
public |
gcd(number: KFractionInputData): Fraction Euclidean algorithm. |
|
public |
Inverse number of this value. |
|
public |
Return true if the value is finite number. |
|
public |
this === Infinity or -Infinity |
|
public |
Return true if the value is integer. |
|
public |
this === NaN |
|
public |
this < 0 |
|
public |
this === -Infinity |
|
public |
this >= 0 |
|
public |
this === 1 |
|
public |
this > 0 |
|
public |
this === Infinity |
|
public |
Return true if the value is prime number. |
|
public |
isProbablePrime(certainty: KFractionInputData): boolean Return true if the value is prime number by Miller-Labin prime number determination method. |
|
public |
Return true if the value is repeating decimal. |
|
public |
this === 0 |
|
public |
lcm(number: KFractionInputData): Fraction Least common multiple. |
|
public |
max(number: KFractionInputData): Fraction Maximum number. |
|
public |
min(number: KFractionInputData): Fraction Minimum number. |
|
public |
mod(num: KFractionInputData): Fraction Modulo, positive remainder of division. |
|
public |
Modular multiplicative inverse. |
|
public |
modPow(exponent: KFractionInputData, m: KFractionInputData): Fraction Modular exponentiation. |
|
public |
mul(num: KFractionInputData): Fraction Multiply. |
|
public |
multiply(number: KFractionInputData): Fraction Multiply. |
|
public |
this * -1 |
|
public |
nextProbablePrime(certainty: KFractionInputData, search_max: KFractionInputData): Fraction Next prime. |
|
public |
Logical Not. |
|
public |
or(number: KFractionInputData): Fraction Logical OR. |
|
public |
pow(num: KFractionInputData): Fraction Power function. |
|
public |
rem(num: KFractionInputData): Fraction Modulo, positive remainder of division. |
|
public |
remainder(number: KFractionInputData): Fraction Remainder of division. |
|
public |
Rounding to the nearest integer. |
|
public |
Multiply a multiple of ten. |
|
public |
this << n
|
|
public |
The positive or negative sign of this number. |
|
public |
The positive or negative sign of this number. |
|
public |
Square. |
|
public |
sub(num: KFractionInputData): Fraction Subtract. |
|
public |
subtract(number: KFractionInputData): Fraction Subtract. |
|
public |
return BigDecimal. |
|
public |
return BigInteger. |
|
public |
return Complex. |
|
public |
return Fraction. |
|
public |
Convert to string. |
|
public |
Convert to JSON. |
|
public |
return Matrix. |
|
public |
toPlainString(depth_max: KFractionInputData): string Convert to string. |
|
public |
Convert to string. |
|
public |
xor(number: KFractionInputData): Fraction Logical Exclusive-OR. |
Inherited Summary
From class KonpeitoInteger | ||
public static get |
-1 |
|
public static get |
Negative Infinity. |
|
public static get |
NaN: KonpeitoInteger: * Not a Number. |
|
public static get |
ONE: KonpeitoInteger: * 1 |
|
public static get |
Positive infinity. |
|
public static get |
TEN: KonpeitoInteger: * 10 |
|
public static get |
TWO: KonpeitoInteger: * 2 |
|
public static get |
ZERO: KonpeitoInteger: * 0 |
|
public static |
create(number: any): KonpeitoInteger Create an entity object of this class. |
|
public static |
valueOf(number: any): KonpeitoInteger Create number. |
|
public get |
booleanValue: boolean: * boolean value. |
|
public get |
doubleValue: number: * floating point. |
|
public get |
integer value. |
|
public |
Absolute value. |
|
public |
add(number: any): KonpeitoInteger Add. |
|
public |
and(number: any): KonpeitoInteger Logical AND. |
|
public |
Ceil. |
|
public |
Deep copy. |
|
public |
Compare values. |
|
public |
div(number: any): KonpeitoInteger Divide. |
|
public |
divide(number: any): KonpeitoInteger Divide. |
|
public |
Equals. |
|
public |
extgcd(number: any): KonpeitoInteger[] Extended Euclidean algorithm. |
|
public |
factor(): KonpeitoInteger[] Factorization. |
|
public |
Factorial function, x!. |
|
public |
To integer rounded down to the nearest. |
|
public |
Floor. |
|
public |
Fraction. |
|
public |
gcd(number: any): KonpeitoInteger Euclidean algorithm. |
|
public |
Inverse number of this value. |
|
public |
Return true if the value is finite number. |
|
public |
this === Infinity or -Infinity |
|
public |
this === NaN |
|
public |
this < 0 |
|
public |
this === -Infinity |
|
public |
this >= 0 |
|
public |
this === 1 |
|
public |
this > 0 |
|
public |
this === Infinity |
|
public |
Return true if the value is prime number. |
|
public |
isProbablePrime(certainty: any): boolean Return true if the value is prime number by Miller-Labin prime number determination method. |
|
public |
this === 0 |
|
public |
lcm(number: any): KonpeitoInteger Least common multiple. |
|
public |
mod(number: any): KonpeitoInteger Modulo, positive rem of division. |
|
public |
modInverse(m: any): KonpeitoInteger Modular multiplicative inverse. |
|
public |
modPow(exponent: any, m: any): KonpeitoInteger Modular exponentiation. |
|
public |
mul(number: any): KonpeitoInteger Multiply. |
|
public |
multiply(number: any): KonpeitoInteger Multiply. |
|
public |
this * -1 |
|
public |
nextProbablePrime(certainty: any, search_max: any): KonpeitoInteger Next prime. |
|
public |
Logical Not. |
|
public |
or(number: any): KonpeitoInteger Logical OR. |
|
public |
pow(exponent: any): KonpeitoInteger Power function. |
|
public |
rem(number: any): KonpeitoInteger Remainder of division. |
|
public |
remainder(number: any): KonpeitoInteger Remainder of division. |
|
public |
Rounding to the nearest integer. |
|
public |
scaleByPowerOfTen(n: any): KonpeitoInteger Multiply a multiple of ten. |
|
public |
shift(n: any): KonpeitoInteger this << n |
|
public |
sign(): any The positive or negative sign of this number. |
|
public |
signum(): any The positive or negative sign of this number. |
|
public |
Square. |
|
public |
sub(number: any): KonpeitoInteger Subtract. |
|
public |
subtract(number: any): KonpeitoInteger Subtract. |
|
public |
return BigDecimal. |
|
public |
return BigInteger. |
|
public |
return Complex. |
|
public |
return Fraction. |
|
public |
Convert to JSON. |
|
public |
return Matrix. |
|
public |
Convert to string. |
|
public |
xor(number: any): KonpeitoInteger Logical Exclusive-OR. |
Static Public Members
public static get NEGATIVE_INFINITY: Fraction: * source
Negative Infinity.
Override:
KonpeitoInteger#NEGATIVE_INFINITYpublic static get POSITIVE_INFINITY: Fraction: * source
Positive infinity.
Override:
KonpeitoInteger#POSITIVE_INFINITYStatic Public Methods
public static create(number: KFractionInputData): Fraction source
Create an entity object of this class.
Override:
KonpeitoInteger#createParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public static valueOf(number: KFractionInputData): Fraction source
Convert number to Fraction type.
Override:
KonpeitoInteger#valueOfParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
Public Constructors
public constructor(number: KFractionInputData) source
Create an fraction.
Initialization can be performed as follows.
- 10, "10", "10/1", "10.0/1.0", ["10", "1"], [10, 1]
- 0.01, "0.01", "0.1e-1", "1/100", [1, 100], [2, 200], ["2", "200"]
- "1/3", "0.[3]", "0.(3)", "0.'3'", "0."3"", [1, 3], [2, 6]
- "3.555(123)" = 3.555123123123..., "147982 / 41625"
Override:
KonpeitoInteger#constructorParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
|
Fraction data. See how to use the function. |
Public Members
Public Methods
public add(num: KFractionInputData): Fraction source
Add.
Override:
KonpeitoInteger#addParams:
Name | Type | Attribute | Description |
num | KFractionInputData |
public and(number: KFractionInputData): Fraction source
Logical AND.
- Calculated as an integer.
Override:
KonpeitoInteger#andParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public clip(min: KFractionInputData, max: KFractionInputData): Fraction source
Clip number within range.
Params:
Name | Type | Attribute | Description |
min | KFractionInputData | ||
max | KFractionInputData |
public compareTo(num: KFractionInputData): number source
Compare values.
Override:
KonpeitoInteger#compareToParams:
Name | Type | Attribute | Description |
num | KFractionInputData |
public div(num: KFractionInputData): Fraction source
Divide.
Override:
KonpeitoInteger#divParams:
Name | Type | Attribute | Description |
num | KFractionInputData |
public divide(number: KFractionInputData): Fraction source
Divide.
Override:
KonpeitoInteger#divideParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public equals(num: KFractionInputData): boolean source
Equals.
Override:
KonpeitoInteger#equalsParams:
Name | Type | Attribute | Description |
num | KFractionInputData |
public equalsState(number: KFractionInputData): boolean source
Numeric type match.
Params:
Name | Type | Attribute | Description |
number | KFractionInputData |
public extgcd(number: KFractionInputData): Array<Fraction> source
Extended Euclidean algorithm.
- Calculated as an integer.
Override:
KonpeitoInteger#extgcdParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public factor(): Fraction[] source
Factorization.
- Calculated as an integer.
- Calculate up to
9007199254740991
.
Override:
KonpeitoInteger#factorpublic factorial(): Fraction source
Factorial function, x!.
- Supports only integers.
Override:
KonpeitoInteger#factorialpublic gcd(number: KFractionInputData): Fraction source
Euclidean algorithm.
- Calculated as an integer.
Override:
KonpeitoInteger#gcdParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public isFinite(): boolean source
Return true if the value is finite number.
Override:
KonpeitoInteger#isFinitepublic isInfinite(): boolean source
this === Infinity or -Infinity
Override:
KonpeitoInteger#isInfinitepublic isNegativeInfinity(): boolean source
this === -Infinity
Override:
KonpeitoInteger#isNegativeInfinitypublic isPositiveInfinity(): boolean source
this === Infinity
Override:
KonpeitoInteger#isPositiveInfinitypublic isPrime(): boolean source
Return true if the value is prime number.
- Calculated as an integer.
- Calculate up to
9007199254740991
.
Override:
KonpeitoInteger#isPrimepublic isProbablePrime(certainty: KFractionInputData): boolean source
Return true if the value is prime number by Miller-Labin prime number determination method.
Attention : it takes a very long time to process.
- Calculated as an integer.
Override:
KonpeitoInteger#isProbablePrimeParams:
Name | Type | Attribute | Description |
certainty | KFractionInputData |
|
Repeat count (prime precision). |
public lcm(number: KFractionInputData): Fraction source
Least common multiple.
- Calculated as an integer.
Override:
KonpeitoInteger#lcmParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public max(number: KFractionInputData): Fraction source
Maximum number.
Params:
Name | Type | Attribute | Description |
number | KFractionInputData |
public min(number: KFractionInputData): Fraction source
Minimum number.
Params:
Name | Type | Attribute | Description |
number | KFractionInputData |
public mod(num: KFractionInputData): Fraction source
Modulo, positive remainder of division.
- Result has same sign as the Divisor.
Override:
KonpeitoInteger#modParams:
Name | Type | Attribute | Description |
num | KFractionInputData |
public modInverse(m: KFractionInputData): Fraction source
Modular multiplicative inverse.
- Calculated as an integer.
Override:
KonpeitoInteger#modInverseParams:
Name | Type | Attribute | Description |
m | KFractionInputData |
public modPow(exponent: KFractionInputData, m: KFractionInputData): Fraction source
Modular exponentiation.
- Calculated as an integer.
Override:
KonpeitoInteger#modPowParams:
Name | Type | Attribute | Description |
exponent | KFractionInputData | ||
m | KFractionInputData |
public mul(num: KFractionInputData): Fraction source
Multiply.
Override:
KonpeitoInteger#mulParams:
Name | Type | Attribute | Description |
num | KFractionInputData |
public multiply(number: KFractionInputData): Fraction source
Multiply.
Override:
KonpeitoInteger#multiplyParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public nextProbablePrime(certainty: KFractionInputData, search_max: KFractionInputData): Fraction source
Next prime.
Override:
KonpeitoInteger#nextProbablePrimeParams:
Name | Type | Attribute | Description |
certainty | KFractionInputData |
|
Repeat count (prime precision). |
search_max | KFractionInputData |
|
Search range of next prime. |
public not(): Fraction source
Logical Not. (mutable)
- Calculated as an integer.
Override:
KonpeitoInteger#notpublic or(number: KFractionInputData): Fraction source
Logical OR.
- Calculated as an integer.
Override:
KonpeitoInteger#orParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public pow(num: KFractionInputData): Fraction source
Power function.
- Supports only integers.
Override:
KonpeitoInteger#powParams:
Name | Type | Attribute | Description |
num | KFractionInputData |
public rem(num: KFractionInputData): Fraction source
Modulo, positive remainder of division.
- Result has same sign as the Dividend.
Override:
KonpeitoInteger#remParams:
Name | Type | Attribute | Description |
num | KFractionInputData |
public remainder(number: KFractionInputData): Fraction source
Remainder of division.
- Result has same sign as the Dividend.
Override:
KonpeitoInteger#remainderParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public scaleByPowerOfTen(n: KFractionInputData): Fraction source
Multiply a multiple of ten.
- Supports only integers.
Override:
KonpeitoInteger#scaleByPowerOfTenParams:
Name | Type | Attribute | Description |
n | KFractionInputData |
public shift(n: KFractionInputData): Fraction source
this << n
- Calculated as an integer.
Override:
KonpeitoInteger#shiftParams:
Name | Type | Attribute | Description |
n | KFractionInputData |
public sign(): number source
The positive or negative sign of this number.
- +1 if positive, -1 if negative, 0 if 0.
Override:
KonpeitoInteger#signpublic signum(): number source
The positive or negative sign of this number.
- +1 if positive, -1 if negative, 0 if 0.
Override:
KonpeitoInteger#signumpublic sub(num: KFractionInputData): Fraction source
Subtract.
Override:
KonpeitoInteger#subParams:
Name | Type | Attribute | Description |
num | KFractionInputData |
public subtract(number: KFractionInputData): Fraction source
Subtract.
Override:
KonpeitoInteger#subtractParams:
Name | Type | Attribute | Description |
number | KFractionInputData |
public toBigDecimal(mc: MathContext): BigDecimal source
return BigDecimal.
Override:
KonpeitoInteger#toBigDecimalParams:
Name | Type | Attribute | Description |
mc | MathContext |
|
MathContext setting after calculation. |
public toPlainString(depth_max: KFractionInputData): string source
Convert to string. For example, output 0.(3)
if 0.333...
.
Params:
Name | Type | Attribute | Description |
depth_max | KFractionInputData |
|
Maximum number of divisions. |
public xor(number: KFractionInputData): Fraction source
Logical Exclusive-OR.
- Calculated as an integer.
Override:
KonpeitoInteger#xorParams:
Name | Type | Attribute | Description |
number | KFractionInputData |