Methods
copyCase(target, source) → {string}
- Description:
- Copy the case of a string into another.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
target |
string | String to change the case. |
source |
string | Source of case pattern. |
Returns:
Converted string.
- Type
- string
factors(number) → {Number}
- Description:
- Prime factorization
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
number |
Number |
Returns:
result
- Type
- Number
factorsBI(number) → {BigInt}
- Description:
- Prime factorization (BigInt version)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
number |
BigInt |
Returns:
result
- Type
- BigInt
gcd(Natural) → {Number}
Parameters:
| Name | Type | Description |
|---|---|---|
Natural |
Number | number |
Returns:
GCD
- Type
- Number
gcdBI(Natural) → {BigInt}
Parameters:
| Name | Type | Description |
|---|---|---|
Natural |
BigInt | BigInt number |
Returns:
GCD
- Type
- BigInt
memoize(Function) → {function}
- Description:
- Memoize function, that builds tree structure for arguments and compares arguments by reference
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
Function |
function | to memoize |
Returns:
Memoized function
- Type
- function
mod(Dividend, Divisor) → {Number}
- Description:
- Python like modulo implementation. It behaves different than JavaScript % with negative values
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
Dividend |
Number | |
Divisor |
Number |
Returns:
Modulus
- Type
- Number
modBI(Dividend, Divisor) → {BigInt}
- Description:
- Python like modulo implementation. It behaves different than JavaScript % with negative values
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
Dividend |
BigInt | |
Divisor |
BigInt |
Returns:
Modulus
- Type
- BigInt
powMod(Base, Exponent, Numberopt) → {Number}
- Description:
- Power like python implementation with optional modulus
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
Base |
Number | ||
Exponent |
Number | ||
Number |
<optional> |
Modulus |
Returns:
Power
- Type
- Number
powModBI(Base, Exponent, BigIntopt) → {BigInt}
- Description:
- Power like python implementation with optional modulus
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
Base |
BigInt | ||
Exponent |
BigInt | ||
BigInt |
<optional> |
Modulus |
Returns:
Power
- Type
- BigInt
squareRoot(number) → {Number}
- Description:
- Native square root
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
number |
Number | js double number |
Returns:
result
- Type
- Number
squareRootBI(number) → {BigInt}
- Description:
- Calculate square root using Newton's formula
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
number |
BigInt | big integer number |
Returns:
result
- Type
- BigInt