Home Reference Source
import Complex from 'konpeito/src/math/core/Complex.js'
public class | source

Complex

Extends:

KonpeitoIntegerKonpeitoFloat → Complex

Complex number class. (immutable)

Static Member Summary

Static Public Members
public static get

E: Complex: *

E, Napier's constant.

public static get

0.5

public static get

0.5 * PI.

public static get

I: Complex: *

i, j

public static get

log_e(10)

public static get

LN2: Complex: *

log_e(2)

public static get

log_10(e)

public static get

log_2(e)

public static get
  • i, - j
public static get

-1

public static get

Negative Infinity.

public static get

NaN: Complex: *

Not a Number.

public static get

ONE: Complex: *

1

public static get

PI: Complex: *

PI.

public static get

Positive infinity.

public static get

0.25 * PI.

public static get

sqrt(0.5)

public static get

sqrt(2)

public static get

TEN: Complex: *

10

public static get

TWO: Complex: *

2

public static get

2 * PI.

public static get

0

Static Method Summary

Static Public Methods
public static

Create an entity object of this class.

public static

rand(random: Random): Complex

Create random values [0, 1) with uniform random numbers.

public static

randn(random: Random): Complex

Create random values with normal distribution.

public static

Convert number to Complex type.

Constructor Summary

Public Constructor
public

Create a complex number.

Member Summary

Public Members
public get

arg: number: *

The argument of this complex number.

public get

boolean value.

public get

floating point.

public get

imag: number: *

The imaginary part of this Comlex.

public get

integer value.

public get

norm: number: *

norm.

public get

real: number: *

The real part of this Comlex.

Private Members
private

The imaginary part of this Comlex.

private

The real part of this Comlex.

Method Summary

Public Methods
public

Absolute value.

public

Arc cosine function.

public

Inverse hyperbolic cosine function.

public

Inverse cotangent function.

public

Inverse hyperbolic cotangent function.

public

Inverse cosecant function.

public

Inverse hyperbolic cosecant function.

public

Add.

public

Logical AND.

public

Reverse secant function.

public

Inverse hyperbolic secant function.

public

Arc sine function.

public

Inverse hyperbolic sine function.

public

Atan (arc tangent) function.

public

Atan (arc tangent) function.

public

Inverse hyperbolic tangent function.

public

Beta function.

public

Cumulative distribution function (CDF) of beta distribution.

public

Incomplete beta function.

public

Inverse function of cumulative distribution function (CDF) of beta distribution.

public

Probability density function (PDF) of beta distribution.

public

Cumulative distribution function (CDF) of binomial distribution.

public

Inverse function of cumulative distribution function (CDF) of binomial distribution.

public

Probability density function (PDF) of binomial distribution.

public

Cube root.

public

Ceil.

public

Cumulative distribution function (CDF) of chi-square distribution.

public

Inverse function of cumulative distribution function (CDF) of chi-square distribution.

public

Probability density function (PDF) of chi-square distribution.

public

Clip number within range.

public

Deep copy.

public

Compare values.

public

Complex conjugate.

public

Cosine function.

public

Hyperbolic cosine function.

public

Cotangent function.

public

Hyperbolic cotangent function.

public

Cosecant function.

public

Hyperbolic cosecant function.

public

Divide.

public

Divide.

public

Inner product/Dot product.

public

Equals.

public

Numeric type match.

public

Error function.

public

Complementary error function.

public

Inverse function of Complementary error function.

public

Inverse function of Error function.

public

Exponential function.

public

e^x - 1

public

Extended Euclidean algorithm.

public

Factorization.

public

Factorial function, x!.

public

Cumulative distribution function (CDF) of F-distribution.

public

Inverse function of cumulative distribution function (CDF) of F-distribution.

public

To integer rounded down to the nearest.

public

Floor.

public

Probability density function (PDF) of F-distribution.

public

Fraction.

public

Cumulative distribution function (CDF) of gamma distribution.

public

Inverse function of cumulative distribution function (CDF) of gamma distribution.

public

Gamma function.

public

Incomplete gamma function.

public

Log-gamma function.

public

Probability density function (PDF) of the gamma distribution.

public

Euclidean algorithm.

public

Return number of decimal places for real and imaginary parts.

public

Inverse number of this value.

public

Returns true if the vallue is complex number (imaginary part is not 0).

public

Returns true if the vallue is complex integer (including normal integer).

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

real(this) < 0

public

this === -Infinity

public

real(this) >= 0

public

this === 1

public

Return true if this real part of the complex positive.

public

this === Infinity

public

Return true if the value is prime number.

public

Return true if the value is prime number by Miller-Labin prime number determination method.

public

Return true if the value is real number.

public

this === 0

public

Least common multiple.

public

Logarithmic function.

public

log_10(x)

public

ln(1 + x)

public

log_2(x)

public

Logit function.

public

Maximum number.

public

Minimum number.

public

Modulo, positive remainder of division.

public

Modular multiplicative inverse.

public

Modular exponentiation.

public

Multiply.

public

Multiply.

public

Binomial coefficient, number of all combinations, nCk.

public

this * -1

public

Next prime.

public

Cumulative distribution function (CDF) of normal distribution.

public

Inverse function of cumulative distribution function (CDF) of normal distribution.

public

Probability density function (PDF) of normal distribution.

public

Logical Not.

public

Logical OR.

public

Cumulative distribution function (CDF) of Poisson distribution.

public

Inverse function of cumulative distribution function (CDF) of Poisson distribution.

public

Probability density function (PDF) of Poisson distribution.

public

Power function.

public

Modulo, positive remainder of division.

public

Remainder of division.

public

Rounding to the nearest integer.

public

Reciprocal square root.

public

Multiply a multiple of ten.

public

Secant function.

public

Hyperbolic secant function.

public

this << n

  • Calculated as an integer.
public

The positive or negative sign of this number.

public

The positive or negative sign of this number.

public

Sine function.

public

Normalized sinc function.

public

Hyperbolic sine function.

public

Square root.

public

Square.

public

Subtract.

public

Subtract.

public

Tangent function.

public

Hyperbolic tangent function.

public

Cumulative distribution function (CDF) of Student's t-distribution.

  • Calculate from real values.
public

Cumulative distribution function (CDF) of Student's t-distribution that can specify tail.

  • Calculate from real values.
public

Inverse of cumulative distribution function (CDF) of Student's t-distribution.

  • Calculate from real values.
public

Inverse of cumulative distribution function (CDF) of Student's t-distribution in two-sided test.

  • Calculate from real values.
public

return BigDecimal.

public

return BigInteger.

public

return Complex.

public

return Fraction.

public

Convert to JSON.

public

return Matrix.

public

Convert to string.

public

Probability density function (PDF) of Student's t-distribution.

  • Calculate from real values.
public

To integer rounded down to the nearest.

public

Logical Exclusive-OR.

Inherited Summary

From class KonpeitoInteger
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

public static

create(number: any): KonpeitoInteger

Create an entity object of this class.

public static

valueOf(number: any): KonpeitoInteger

Create number.

public get

boolean value.

public get

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

compareTo(number: any): number

Compare values.

public

div(number: any): KonpeitoInteger

Divide.

public

divide(number: any): KonpeitoInteger

Divide.

public

equals(number: any): boolean

Equals.

public

extgcd(number: any): KonpeitoInteger[]

Extended Euclidean algorithm.

public

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

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

Multiply a multiple of ten.

public

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.

From class KonpeitoFloat
public static get

E, Napier's constant.

public static get

0.5

public static get

0.5 * PI.

public static get

log_e(10)

public static get

log_e(2)

public static get

log_10(e)

public static get

log_2(e)

public static get

PI.

public static get

0.25 * PI.

public static get

sqrt(0.5)

public static get

sqrt(2)

public static get

2 * PI.

public

Arc cosine function.

public

Inverse hyperbolic cosine function.

public

Inverse cotangent function.

public

Inverse hyperbolic cotangent function.

public

Inverse cosecant function.

public

Inverse hyperbolic cosecant function.

public

Reverse secant function.

public

Inverse hyperbolic secant function.

public

Arc sine function.

public

Inverse hyperbolic sine function.

public

Atan (arc tangent) function.

public

atan2(number: any): KonpeitoFloat

Atan (arc tangent) function.

public

Inverse hyperbolic tangent function.

public

Cube root.

public

Cosine function.

public

Hyperbolic cosine function.

public

Cotangent function.

public

Hyperbolic cotangent function.

public

Cosecant function.

public

Hyperbolic cosecant function.

public

Exponential function.

public

e^x - 1

public

Logarithmic function.

public

log_10(x)

public

ln(1 + x)

public

log_2(x)

public

Logit function.

public

Reciprocal square root.

public

Secant function.

public

Hyperbolic secant function.

public

Sine function.

public

Normalized sinc function.

public

Hyperbolic sine function.

public

Square root.

public

Tangent function.

public

Hyperbolic tangent function.

Static Public Members

public static get E: Complex: * source

E, Napier's constant.

Override:

KonpeitoFloat#E

Return:

Complex

2.71...

public static get HALF: Complex: * source

0.5

Override:

KonpeitoFloat#HALF

Return:

Complex

0.5

public static get HALF_PI: Complex: * source

0.5 * PI.

Override:

KonpeitoFloat#HALF_PI

Return:

Complex

1.57...

public static get I: Complex: * source

i, j

Return:

Complex

i

public static get LN10: Complex: * source

log_e(10)

Override:

KonpeitoFloat#LN10

Return:

Complex

ln(10)

public static get LN2: Complex: * source

log_e(2)

Override:

KonpeitoFloat#LN2

Return:

Complex

ln(2)

public static get LOG10E: Complex: * source

log_10(e)

Override:

KonpeitoFloat#LOG10E

Return:

Complex

log_10(e)

public static get LOG2E: Complex: * source

log_2(e)

Override:

KonpeitoFloat#LOG2E

Return:

Complex

log_2(e)

public static get MINUS_I: Complex: * source

  • i, - j

Return:

Complex

i

public static get MINUS_ONE: Complex: * source

-1

Override:

KonpeitoInteger#MINUS_ONE

Return:

Complex

1

public static get NEGATIVE_INFINITY: Complex: * source

Negative Infinity.

Override:

KonpeitoInteger#NEGATIVE_INFINITY

Return:

Complex

Infinity

public static get NaN: Complex: * source

Not a Number.

Override:

KonpeitoInteger#NaN

Return:

Complex

NaN

public static get ONE: Complex: * source

1

Override:

KonpeitoInteger#ONE

Return:

Complex

1

public static get PI: Complex: * source

PI.

Override:

KonpeitoFloat#PI

Return:

Complex

3.14...

public static get POSITIVE_INFINITY: Complex: * source

Positive infinity.

Override:

KonpeitoInteger#POSITIVE_INFINITY

Return:

Complex

Infinity

public static get QUARTER_PI: Complex: * source

0.25 * PI.

Override:

KonpeitoFloat#QUARTER_PI

Return:

Complex

0.78...

public static get SQRT1_2: Complex: * source

sqrt(0.5)

Override:

KonpeitoFloat#SQRT1_2

Return:

Complex

sqrt(0.5)

public static get SQRT2: Complex: * source

sqrt(2)

Override:

KonpeitoFloat#SQRT2

Return:

Complex

sqrt(2)

public static get TEN: Complex: * source

10

Override:

KonpeitoInteger#TEN

Return:

Complex

10

public static get TWO: Complex: * source

2

Override:

KonpeitoInteger#TWO

Return:

Complex

2

public static get TWO_PI: Complex: * source

2 * PI.

Override:

KonpeitoFloat#TWO_PI

Return:

Complex

6.28...

public static get ZERO: Complex: * source

0

Override:

KonpeitoInteger#ZERO

Return:

Complex

0

Static Public Methods

public static create(number: KComplexInputData): Complex source

Create an entity object of this class.

Override:

KonpeitoInteger#create

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

public static rand(random: Random): Complex source

Create random values [0, 1) with uniform random numbers.

Params:

NameTypeAttributeDescription
random Random
  • optional

Class for creating random numbers.

Return:

Complex

public static randn(random: Random): Complex source

Create random values with normal distribution.

Params:

NameTypeAttributeDescription
random Random
  • optional

Class for creating random numbers.

Return:

Complex

public static valueOf(number: KComplexInputData): Complex source

Convert number to Complex type.

Override:

KonpeitoInteger#valueOf

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

Public Constructors

public constructor(number: KComplexInputData) source

Create a complex number.

Initialization can be performed as follows.

  • 1200, "1200", "12e2", "1.2e3"
  • "3 + 4i", "4j + 3", [3, 4].

Override:

KonpeitoFloat#constructor

Params:

NameTypeAttributeDescription
number KComplexInputData

Complex number. See how to use the function.

Public Members

public get arg: number: * source

The argument of this complex number.

Return:

number

arg(A)

public get booleanValue: boolean: * source

boolean value.

Override:

KonpeitoInteger#booleanValue

Return:

boolean

public get doubleValue: number: * source

floating point.

Override:

KonpeitoInteger#doubleValue

Return:

number

public get imag: number: * source

The imaginary part of this Comlex.

Return:

number

imag(A)

public get intValue: number: * source

integer value.

Override:

KonpeitoInteger#intValue

Return:

number

public get norm: number: * source

norm.

Return:

number

|A|

public get real: number: * source

The real part of this Comlex.

Return:

number

real(A)

Private Members

private _im: number source

The imaginary part of this Comlex.

private _re: number source

The real part of this Comlex.

Public Methods

public abs(): Complex source

Absolute value.

Override:

KonpeitoInteger#abs

Return:

Complex

abs(A)

public acos(): Complex source

Arc cosine function.

Override:

KonpeitoFloat#acos

Return:

Complex

acos(A)

public acosh(): Complex source

Inverse hyperbolic cosine function.

Override:

KonpeitoFloat#acosh

Return:

Complex

acosh(A)

public acot(): Complex source

Inverse cotangent function.

Override:

KonpeitoFloat#acot

Return:

Complex

acot(A)

public acoth(): Complex source

Inverse hyperbolic cotangent function.

Override:

KonpeitoFloat#acoth

Return:

Complex

acoth(A)

public acsc(): Complex source

Inverse cosecant function.

Override:

KonpeitoFloat#acsc

Return:

Complex

acsc(A)

public acsch(): Complex source

Inverse hyperbolic cosecant function.

Override:

KonpeitoFloat#acsch

Return:

Complex

acsch(A)

public add(number: KComplexInputData): Complex source

Add.

Override:

KonpeitoInteger#add

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A + B

public and(number: KComplexInputData): Complex source

Logical AND.

  • Calculated as an integer.

Override:

KonpeitoInteger#and

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A & B

public asec(): Complex source

Reverse secant function.

Override:

KonpeitoFloat#asec

Return:

Complex

asec(A)

public asech(): Complex source

Inverse hyperbolic secant function.

Override:

KonpeitoFloat#asech

Return:

Complex

asech(A)

public asin(): Complex source

Arc sine function.

Override:

KonpeitoFloat#asin

Return:

Complex

asin(A)

public asinh(): Complex source

Inverse hyperbolic sine function.

Override:

KonpeitoFloat#asinh

Return:

Complex

asinh(A)

public atan(): Complex source

Atan (arc tangent) function.

  • Return the values of [-PI/2, PI/2].

Override:

KonpeitoFloat#atan

Return:

Complex

atan(A)

public atan2(number: KComplexInputData): Complex source

Atan (arc tangent) function. Return the values of [-PI, PI] . Supports only real numbers.

Override:

KonpeitoFloat#atan2

Params:

NameTypeAttributeDescription
number KComplexInputData
  • optional

X

Return:

Complex

atan2(Y, X)

public atanh(): Complex source

Inverse hyperbolic tangent function.

Override:

KonpeitoFloat#atanh

Return:

Complex

atanh(A)

public beta(y: KComplexInputData): Complex source

Beta function.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
y KComplexInputData

Return:

Complex

public betacdf(a: KComplexInputData, b: KComplexInputData): Complex source

Cumulative distribution function (CDF) of beta distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
a KComplexInputData
b KComplexInputData

Return:

Complex

public betainc(a: KComplexInputData, b: KComplexInputData, tail: string): Complex source

Incomplete beta function.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
a KComplexInputData
b KComplexInputData
tail string
  • optional
  • default: "lower"

lower (default) , "upper"

Return:

Complex

public betainv(a: KComplexInputData, b: KComplexInputData): Complex source

Inverse function of cumulative distribution function (CDF) of beta distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
a KComplexInputData
b KComplexInputData

Return:

Complex

public betapdf(a: KComplexInputData, b: KComplexInputData): Complex source

Probability density function (PDF) of beta distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
a KComplexInputData
b KComplexInputData

Return:

Complex

public binocdf(n: KComplexInputData, p: KComplexInputData, tail: string): Complex source

Cumulative distribution function (CDF) of binomial distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
n KComplexInputData
p KComplexInputData
tail string
  • optional
  • default: "lower"

lower (default) , "upper"

Return:

Complex

public binoinv(n: KComplexInputData, p: KComplexInputData): Complex source

Inverse function of cumulative distribution function (CDF) of binomial distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
n KComplexInputData
p KComplexInputData

Return:

Complex

public binopdf(n: KComplexInputData, p: KComplexInputData): Complex source

Probability density function (PDF) of binomial distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
n KComplexInputData
p KComplexInputData

Return:

Complex

public cbrt(n: KComplexInputData): Complex source

Cube root.

Override:

KonpeitoFloat#cbrt

Params:

NameTypeAttributeDescription
n KComplexInputData
  • optional
  • default: 0

Value type(0,1,2)

Return:

Complex

cbrt(A)

public ceil(): Complex source

Ceil.

Override:

KonpeitoInteger#ceil

Return:

Complex

ceil(A)

public chi2cdf(k: KComplexInputData): Complex source

Cumulative distribution function (CDF) of chi-square distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
k KComplexInputData

The degrees of freedom. (DF)

Return:

Complex

public chi2inv(k: KComplexInputData): Complex source

Inverse function of cumulative distribution function (CDF) of chi-square distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
k KComplexInputData

The degrees of freedom. (DF)

Return:

Complex

public chi2pdf(k: KComplexInputData): Complex source

Probability density function (PDF) of chi-square distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
k KComplexInputData

The degrees of freedom. (DF)

Return:

Complex

public clip(min: KComplexInputData, max: KComplexInputData): Complex source

Clip number within range.

Params:

NameTypeAttributeDescription
min KComplexInputData
max KComplexInputData

Return:

Complex

min(max(x, min), max)

public clone(): Complex source

Deep copy.

Override:

KonpeitoInteger#clone

Return:

Complex

public compareTo(number: KComplexInputData, tolerance: KComplexInputData): number source

Compare values.

Override:

KonpeitoInteger#compareTo

Params:

NameTypeAttributeDescription
number KComplexInputData
tolerance KComplexInputData
  • optional
  • default: Number.EPSILON

Calculation tolerance of calculation.

Return:

number

A > B ? 1 : (A === B ? 0 : -1)

public conj(): Complex source

Complex conjugate.

Return:

Complex

real(A) - imag(A)j

public cos(): Complex source

Cosine function.

Override:

KonpeitoFloat#cos

Return:

Complex

cos(A)

public cosh(): Complex source

Hyperbolic cosine function.

Override:

KonpeitoFloat#cosh

Return:

Complex

cosh(A)

public cot(): Complex source

Cotangent function.

Override:

KonpeitoFloat#cot

Return:

Complex

cot(A)

public coth(): Complex source

Hyperbolic cotangent function.

Override:

KonpeitoFloat#coth

Return:

Complex

coth(A)

public csc(): Complex source

Cosecant function.

Override:

KonpeitoFloat#csc

Return:

Complex

csc(A)

public csch(): Complex source

Hyperbolic cosecant function.

Override:

KonpeitoFloat#csch

Return:

Complex

csch(A)

public div(number: KComplexInputData): Complex source

Divide.

Override:

KonpeitoInteger#div

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A / B

public divide(number: KComplexInputData): Complex source

Divide.

Override:

KonpeitoInteger#divide

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

fix(A / B)

public dot(number: KComplexInputData): Complex source

Inner product/Dot product.

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A * conj(B)

public equals(number: KComplexInputData, tolerance: KComplexInputData): boolean source

Equals.

Override:

KonpeitoInteger#equals

Params:

NameTypeAttributeDescription
number KComplexInputData
tolerance KComplexInputData
  • optional
  • default: Number.EPSILON

Calculation tolerance of calculation.

Return:

boolean

A === B

public equalsState(number: KComplexInputData): boolean source

Numeric type match.

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

boolean

public erf(): Complex source

Error function.

  • Calculate from real values.

Return:

Complex

public erfc(): Complex source

Complementary error function.

  • Calculate from real values.

Return:

Complex

public erfcinv(): Complex source

Inverse function of Complementary error function.

  • Calculate from real values.

Return:

Complex

public erfinv(): Complex source

Inverse function of Error function.

  • Calculate from real values.

Return:

Complex

public exp(): Complex source

Exponential function.

Override:

KonpeitoFloat#exp

Return:

Complex

exp(A)

public expm1(): Complex source

e^x - 1

Override:

KonpeitoFloat#expm1

Return:

Complex

expm1(A)

public extgcd(number: KComplexInputData): Array<Complex> source

Extended Euclidean algorithm.

  • Calculated as an integer.

Override:

KonpeitoInteger#extgcd

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Array<Complex>

[a, b, gcd(x, y)], Result of calculating ax + by = gcd(x, y).

public factor(): Complex[] source

Factorization.

  • Calculated as an integer.
  • Calculate up to 9007199254740991.

Override:

KonpeitoInteger#factor

Return:

Complex[]

factor

public factorial(): Complex source

Factorial function, x!.

  • Calculate from real values.

Override:

KonpeitoInteger#factorial

Return:

Complex

public fcdf(d1: KComplexInputData, d2: KComplexInputData): Complex source

Cumulative distribution function (CDF) of F-distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
d1 KComplexInputData

The degree of freedom of the molecules.

d2 KComplexInputData

The degree of freedom of the denominator

Return:

Complex

public finv(d1: KComplexInputData, d2: KComplexInputData): Complex source

Inverse function of cumulative distribution function (CDF) of F-distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
d1 KComplexInputData

The degree of freedom of the molecules.

d2 KComplexInputData

The degree of freedom of the denominator

Return:

Complex

public fix(): Complex source

To integer rounded down to the nearest.

Override:

KonpeitoInteger#fix

Return:

Complex

fix(A), trunc(A)

public floor(): Complex source

Floor.

Override:

KonpeitoInteger#floor

Return:

Complex

floor(A)

public fpdf(d1: KComplexInputData, d2: KComplexInputData): Complex source

Probability density function (PDF) of F-distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
d1 KComplexInputData

The degree of freedom of the molecules.

d2 KComplexInputData

The degree of freedom of the denominator

Return:

Complex

public fract(): Complex source

Fraction.

Override:

KonpeitoInteger#fract

Return:

Complex

fract(A)

public gamcdf(k: KComplexInputData, s: KComplexInputData): Complex source

Cumulative distribution function (CDF) of gamma distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
k KComplexInputData

Shape parameter.

s KComplexInputData

Scale parameter.

Return:

Complex

public gaminv(k: KComplexInputData, s: KComplexInputData): Complex source

Inverse function of cumulative distribution function (CDF) of gamma distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
k KComplexInputData

Shape parameter.

s KComplexInputData

Scale parameter.

Return:

Complex

public gamma(): Complex source

Gamma function.

  • Calculate from real values.

Return:

Complex

public gammainc(a: KComplexInputData, tail: string): Complex source

Incomplete gamma function.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
a KComplexInputData
tail string
  • optional
  • default: "lower"

lower (default) , "upper"

Return:

Complex

public gammaln(): Complex source

Log-gamma function.

  • Calculate from real values.

Return:

Complex

public gampdf(k: KComplexInputData, s: KComplexInputData): Complex source

Probability density function (PDF) of the gamma distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
k KComplexInputData

Shape parameter.

s KComplexInputData

Scale parameter.

Return:

Complex

public gcd(number: KComplexInputData): Complex source

Euclidean algorithm.

  • Calculated as an integer.

Override:

KonpeitoInteger#gcd

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

gcd(x, y)

public getDecimalPosition(): number source

Return number of decimal places for real and imaginary parts.

  • Used to make a string.

Return:

number

Number of decimal places.

public inv(): Complex source

Inverse number of this value.

Override:

KonpeitoInteger#inv

Return:

Complex

1 / A

public isComplex(tolerance: KComplexInputData): boolean source

Returns true if the vallue is complex number (imaginary part is not 0).

Params:

NameTypeAttributeDescription
tolerance KComplexInputData
  • optional
  • default: Number.EPSILON

Calculation tolerance of calculation.

Return:

boolean

imag(A) !== 0

public isComplexInteger(tolerance: KComplexInputData): boolean source

Returns true if the vallue is complex integer (including normal integer).

Params:

NameTypeAttributeDescription
tolerance KComplexInputData
  • optional
  • default: Number.EPSILON

Calculation tolerance of calculation.

Return:

boolean

real(A) === integer && imag(A) === integer

public isFinite(): boolean source

Return true if the value is finite number.

Override:

KonpeitoInteger#isFinite

Return:

boolean

!isNaN(A) && !isInfinite(A)

public isInfinite(): boolean source

this === Infinity or -Infinity

Override:

KonpeitoInteger#isInfinite

Return:

boolean

isPositiveInfinity(A) || isNegativeInfinity(A)

public isInteger(tolerance: KComplexInputData): boolean source

Return true if the value is integer.

Params:

NameTypeAttributeDescription
tolerance KComplexInputData
  • optional
  • default: Number.EPSILON

Calculation tolerance of calculation.

Return:

boolean

public isNaN(): boolean source

this === NaN

Override:

KonpeitoInteger#isNaN

Return:

boolean

isNaN(A)

public isNegative(): boolean source

real(this) < 0

Override:

KonpeitoInteger#isNegative

Return:

boolean

real(x) < 0

public isNegativeInfinity(): boolean source

this === -Infinity

Override:

KonpeitoInteger#isNegativeInfinity

Return:

boolean

isNegativeInfinity(A)

public isNotNegative(): boolean source

real(this) >= 0

Override:

KonpeitoInteger#isNotNegative

Return:

boolean

real(x) >= 0

public isOne(tolerance: KComplexInputData): boolean source

this === 1

Override:

KonpeitoInteger#isOne

Params:

NameTypeAttributeDescription
tolerance KComplexInputData
  • optional
  • default: Number.EPSILON

Calculation tolerance of calculation.

Return:

boolean

A === 1

public isPositive(): boolean source

Return true if this real part of the complex positive.

Override:

KonpeitoInteger#isPositive

Return:

boolean

real(x) > 0

public isPositiveInfinity(): boolean source

this === Infinity

Override:

KonpeitoInteger#isPositiveInfinity

Return:

boolean

isPositiveInfinity(A)

public isPrime(): boolean source

Return true if the value is prime number.

  • Calculated as an integer.
  • Calculate up to 9007199254740991.

Override:

KonpeitoInteger#isPrime

Return:

boolean

If the calculation range is exceeded, null is returned.

public isProbablePrime(certainty: KComplexInputData): 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#isProbablePrime

Params:

NameTypeAttributeDescription
certainty KComplexInputData
  • optional
  • default: 100

Repeat count (prime precision).

Return:

boolean

public isReal(tolerance: KComplexInputData): boolean source

Return true if the value is real number.

Params:

NameTypeAttributeDescription
tolerance KComplexInputData
  • optional
  • default: Number.EPSILON

Calculation tolerance of calculation.

Return:

boolean

imag(A) === 0

public isZero(tolerance: KComplexInputData): boolean source

this === 0

Override:

KonpeitoInteger#isZero

Params:

NameTypeAttributeDescription
tolerance KComplexInputData
  • optional
  • default: Number.EPSILON

Calculation tolerance of calculation.

Return:

boolean

A === 0

public lcm(number: KComplexInputData): Complex source

Least common multiple.

  • Calculated as an integer.

Override:

KonpeitoInteger#lcm

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

lcm(x, y)

public log(): Complex source

Logarithmic function.

Override:

KonpeitoFloat#log

Return:

Complex

log(A)

public log10(): Complex source

log_10(x)

Override:

KonpeitoFloat#log10

Return:

Complex

log10(A)

public log1p(): Complex source

ln(1 + x)

Override:

KonpeitoFloat#log1p

Return:

Complex

log1p(A)

public log2(): Complex source

log_2(x)

Override:

KonpeitoFloat#log2

Return:

Complex

log2(A)

public logit(): Complex source

Logit function.

Override:

KonpeitoFloat#logit

Return:

Complex

logit(A)

public max(number: KComplexInputData): Complex source

Maximum number.

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

max([A, B])

public min(number: KComplexInputData): Complex source

Minimum number.

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

min([A, B])

public mod(number: KComplexInputData): Complex source

Modulo, positive remainder of division.

  • Result has same sign as the Divisor.

Override:

KonpeitoInteger#mod

Params:

NameTypeAttributeDescription
number KComplexInputData

Divided value (real number only).

Return:

Complex

A mod B

public modInverse(m: KComplexInputData): Complex source

Modular multiplicative inverse.

  • Calculated as an integer.

Override:

KonpeitoInteger#modInverse

Params:

NameTypeAttributeDescription
m KComplexInputData

Return:

Complex

A^(-1) mod m

public modPow(exponent: KComplexInputData, m: KComplexInputData): Complex source

Modular exponentiation.

  • Calculated as an integer.

Override:

KonpeitoInteger#modPow

Params:

NameTypeAttributeDescription
exponent KComplexInputData
m KComplexInputData

Return:

Complex

A^B mod m

public mul(number: KComplexInputData): Complex source

Multiply.

Override:

KonpeitoInteger#mul

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A * B

public multiply(number: KComplexInputData): Complex source

Multiply.

Override:

KonpeitoInteger#multiply

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A * B

public nchoosek(k: KComplexInputData): Complex source

Binomial coefficient, number of all combinations, nCk.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
k KComplexInputData

Return:

Complex

public negate(): Complex source

this * -1

Override:

KonpeitoInteger#negate

Return:

Complex

A

public nextProbablePrime(certainty: KComplexInputData, search_max: KComplexInputData): Complex source

Next prime.

Override:

KonpeitoInteger#nextProbablePrime

Params:

NameTypeAttributeDescription
certainty KComplexInputData
  • optional
  • default: 100

Repeat count (prime precision).

search_max KComplexInputData
  • optional
  • default: 100000

Search range of next prime.

Return:

Complex

public normcdf(u: KComplexInputData, s: KComplexInputData): Complex source

Cumulative distribution function (CDF) of normal distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
u KComplexInputData
  • optional
  • default: 0.0

Average value.

s KComplexInputData
  • optional
  • default: 1.0

Variance value.

Return:

Complex

public norminv(u: KComplexInputData, s: KComplexInputData): Complex source

Inverse function of cumulative distribution function (CDF) of normal distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
u KComplexInputData
  • optional
  • default: 0.0

Average value.

s KComplexInputData
  • optional
  • default: 1.0

Variance value.

Return:

Complex

public normpdf(u: KComplexInputData, s: KComplexInputData): Complex source

Probability density function (PDF) of normal distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
u KComplexInputData
  • optional
  • default: 0.0

Average value.

s KComplexInputData
  • optional
  • default: 1.0

Variance value.

Return:

Complex

public not(): Complex source

Logical Not. (mutable)

  • Calculated as an integer.

Override:

KonpeitoInteger#not

Return:

Complex

!A

public or(number: KComplexInputData): Complex source

Logical OR.

  • Calculated as an integer.

Override:

KonpeitoInteger#or

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A | B

public poisscdf(lambda: KComplexInputData): Complex source

Cumulative distribution function (CDF) of Poisson distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
lambda KComplexInputData

Return:

Complex

public poissinv(lambda: KComplexInputData): Complex source

Inverse function of cumulative distribution function (CDF) of Poisson distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
lambda KComplexInputData

Return:

Complex

public poisspdf(lambda: KComplexInputData): Complex source

Probability density function (PDF) of Poisson distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
lambda KComplexInputData

Return:

Complex

public pow(number: KComplexInputData): Complex source

Power function.

Override:

KonpeitoInteger#pow

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

pow(A, B)

public rem(number: KComplexInputData): Complex source

Modulo, positive remainder of division.

  • Result has same sign as the Dividend.

Override:

KonpeitoInteger#rem

Params:

NameTypeAttributeDescription
number KComplexInputData

Divided value (real number only).

Return:

Complex

A rem B

public remainder(number: KComplexInputData): Complex source

Remainder of division.

  • Result has same sign as the Dividend.

Override:

KonpeitoInteger#remainder

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A % B

public round(): Complex source

Rounding to the nearest integer.

Override:

KonpeitoInteger#round

Return:

Complex

round(A)

public rsqrt(): Complex source

Reciprocal square root.

Override:

KonpeitoFloat#rsqrt

Return:

Complex

rsqrt(A)

public scaleByPowerOfTen(n: KComplexInputData): Complex source

Multiply a multiple of ten.

Override:

KonpeitoInteger#scaleByPowerOfTen

Params:

NameTypeAttributeDescription
n KComplexInputData

Return:

Complex

x * 10^n

public sec(): Complex source

Secant function.

Override:

KonpeitoFloat#sec

Return:

Complex

sec(A)

public sech(): Complex source

Hyperbolic secant function.

Override:

KonpeitoFloat#sech

Return:

Complex

sech(A)

public shift(n: KComplexInputData): Complex source

this << n

  • Calculated as an integer.

Override:

KonpeitoInteger#shift

Params:

NameTypeAttributeDescription
n KComplexInputData

Return:

Complex

A << n

public sign(): Complex source

The positive or negative sign of this number.

  • +1 if positive, -1 if negative, 0 if 0.

Override:

KonpeitoInteger#sign

Return:

Complex

public signum(): Complex source

The positive or negative sign of this number.

  • +1 if positive, -1 if negative, 0 if 0.

Override:

KonpeitoInteger#signum

Return:

Complex

public sin(): Complex source

Sine function.

Override:

KonpeitoFloat#sin

Return:

Complex

sin(A)

public sinc(): Complex source

Normalized sinc function.

Override:

KonpeitoFloat#sinc

Return:

Complex

sinc(A)

public sinh(): Complex source

Hyperbolic sine function.

Override:

KonpeitoFloat#sinh

Return:

Complex

sinh(A)

public sqrt(): Complex source

Square root.

Override:

KonpeitoFloat#sqrt

Return:

Complex

sqrt(A)

public square(): Complex source

Square.

Override:

KonpeitoInteger#square

Return:

Complex

pow(A, 2)

public sub(number: KComplexInputData): Complex source

Subtract.

Override:

KonpeitoInteger#sub

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A - B

public subtract(number: KComplexInputData): Complex source

Subtract.

Override:

KonpeitoInteger#subtract

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A - B

public tan(): Complex source

Tangent function.

Override:

KonpeitoFloat#tan

Return:

Complex

tan(A)

public tanh(): Complex source

Hyperbolic tangent function.

Override:

KonpeitoFloat#tanh

Return:

Complex

tanh(A)

public tcdf(v: KComplexInputData): Complex source

Cumulative distribution function (CDF) of Student's t-distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
v KComplexInputData

The degrees of freedom. (DF)

Return:

Complex

public tdist(v: KComplexInputData, tails: KComplexInputData): Complex source

Cumulative distribution function (CDF) of Student's t-distribution that can specify tail.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
v KComplexInputData

The degrees of freedom. (DF)

tails KComplexInputData

Tail. (1 = the one-tailed distribution, 2 = the two-tailed distribution.)

Return:

Complex

public tinv(v: KComplexInputData): Complex source

Inverse of cumulative distribution function (CDF) of Student's t-distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
v KComplexInputData

The degrees of freedom. (DF)

Return:

Complex

public tinv2(v: KComplexInputData): Complex source

Inverse of cumulative distribution function (CDF) of Student's t-distribution in two-sided test.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
v KComplexInputData

The degrees of freedom. (DF)

Return:

Complex

public toBigDecimal(mc: MathContext): BigDecimal source

return BigDecimal.

Override:

KonpeitoInteger#toBigDecimal

Params:

NameTypeAttributeDescription
mc MathContext
  • optional

MathContext setting after calculation.

Return:

BigDecimal

public toBigInteger(): BigInteger source

return BigInteger.

Override:

KonpeitoInteger#toBigInteger

Return:

BigInteger

public toComplex(): Complex source

return Complex.

Override:

KonpeitoInteger#toComplex

Return:

Complex

public toFraction(): Fraction source

return Fraction.

Override:

KonpeitoInteger#toFraction

Return:

Fraction

public toJSON(): string source

Convert to JSON.

Override:

KonpeitoInteger#toJSON

Return:

string

public toMatrix(): Matrix source

return Matrix.

Override:

KonpeitoInteger#toMatrix

Return:

Matrix

public toString(): string source

Convert to string.

Override:

KonpeitoInteger#toString

Return:

string

public tpdf(v: KComplexInputData): Complex source

Probability density function (PDF) of Student's t-distribution.

  • Calculate from real values.

Params:

NameTypeAttributeDescription
v KComplexInputData

The degrees of freedom. (DF)

Return:

Complex

public trunc(): Complex source

To integer rounded down to the nearest.

Return:

Complex

fix(A), trunc(A)

public xor(number: KComplexInputData): Complex source

Logical Exclusive-OR.

  • Calculated as an integer.

Override:

KonpeitoInteger#xor

Params:

NameTypeAttributeDescription
number KComplexInputData

Return:

Complex

A ^ B