KonpeitoInteger
Direct Subclass:
Indirect Subclass:
Base class for numbers (immutable).
Static Member Summary
Static Public Members | ||
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 |
Static Method Summary
Static Public Methods | ||
public static |
create(number: any): KonpeitoInteger Create an entity object of this class. |
|
public static |
valueOf(number: any): KonpeitoInteger Create number. |
Constructor Summary
Public Constructor | ||
public |
constructor(number: any) Create an number. |
Member Summary
Public Members | ||
public get |
booleanValue: boolean: * boolean value. |
|
public get |
doubleValue: number: * floating point. |
|
public get |
integer value. |
Method Summary
Public Methods | ||
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
Static Public Methods
public static create(number: any): KonpeitoInteger source
Create an entity object of this class.
Params:
Name | Type | Attribute | Description |
number | any |
public static valueOf(number: any): KonpeitoInteger source
Create number.
Params:
Name | Type | Attribute | Description |
number | any |
Public Constructors
public constructor(number: any) source
Create an number.
Params:
Name | Type | Attribute | Description |
number | any |
|
Numeric data. See how to use the function. |
Public Members
Public Methods
public add(number: any): KonpeitoInteger source
Add.
Params:
Name | Type | Attribute | Description |
number | any |
public and(number: any): KonpeitoInteger source
Logical AND.
Params:
Name | Type | Attribute | Description |
number | any |
public compareTo(number: any): number source
Compare values.
Params:
Name | Type | Attribute | Description |
number | any |
public div(number: any): KonpeitoInteger source
Divide.
Params:
Name | Type | Attribute | Description |
number | any |
public divide(number: any): KonpeitoInteger source
Divide.
Params:
Name | Type | Attribute | Description |
number | any |
public extgcd(number: any): KonpeitoInteger[] source
Extended Euclidean algorithm.
Params:
Name | Type | Attribute | Description |
number | any |
public gcd(number: any): KonpeitoInteger source
Euclidean algorithm.
Params:
Name | Type | Attribute | Description |
number | any |
public isPrime(): boolean source
Return true if the value is prime number.
- Calculate up to
9007199254740991
.
public isProbablePrime(certainty: any): 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.
Params:
Name | Type | Attribute | Description |
certainty | any |
|
Repeat count (prime precision). |
public lcm(number: any): KonpeitoInteger source
Least common multiple.
Params:
Name | Type | Attribute | Description |
number | any |
public mod(number: any): KonpeitoInteger source
Modulo, positive rem of division.
- Result has same sign as the Divisor.
Params:
Name | Type | Attribute | Description |
number | any |
public modInverse(m: any): KonpeitoInteger source
Modular multiplicative inverse.
Params:
Name | Type | Attribute | Description |
m | any |
public modPow(exponent: any, m: any): KonpeitoInteger source
Modular exponentiation.
Params:
Name | Type | Attribute | Description |
exponent | any | ||
m | any |
public mul(number: any): KonpeitoInteger source
Multiply.
Params:
Name | Type | Attribute | Description |
number | any |
public multiply(number: any): KonpeitoInteger source
Multiply.
Params:
Name | Type | Attribute | Description |
number | any |
public nextProbablePrime(certainty: any, search_max: any): KonpeitoInteger source
Next prime.
Params:
Name | Type | Attribute | Description |
certainty | any |
|
Repeat count (prime precision). |
search_max | any |
|
Search range of next prime. |
public or(number: any): KonpeitoInteger source
Logical OR.
Params:
Name | Type | Attribute | Description |
number | any |
public pow(exponent: any): KonpeitoInteger source
Power function.
Params:
Name | Type | Attribute | Description |
exponent | any |
public rem(number: any): KonpeitoInteger source
Remainder of division.
- Result has same sign as the Dividend.
Params:
Name | Type | Attribute | Description |
number | any |
public remainder(number: any): KonpeitoInteger source
Remainder of division.
- Result has same sign as the Dividend.
Params:
Name | Type | Attribute | Description |
number | any |
public scaleByPowerOfTen(n: any): KonpeitoInteger source
Multiply a multiple of ten.
Params:
Name | Type | Attribute | Description |
n | any |
public sign(): any source
The positive or negative sign of this number.
- +1 if positive, -1 if negative, 0 if 0.
Return:
any |
public signum(): any source
The positive or negative sign of this number.
- +1 if positive, -1 if negative, 0 if 0.
Return:
any |
public sub(number: any): KonpeitoInteger source
Subtract.
Params:
Name | Type | Attribute | Description |
number | any |
public subtract(number: any): KonpeitoInteger source
Subtract.
Params:
Name | Type | Attribute | Description |
number | any |
public toBigDecimal(mc: MathContext): BigDecimal source
return BigDecimal.
Params:
Name | Type | Attribute | Description |
mc | MathContext |
|
MathContext setting after calculation. |
public xor(number: any): KonpeitoInteger source
Logical Exclusive-OR.
Params:
Name | Type | Attribute | Description |
number | any |