Options
All
  • Public
  • Public/Protected
  • All
Menu

128-bit complex number.

Hierarchy

  • Complex128

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Complex128(real: number, imag: number): Complex128

Properties

BYTES_PER_ELEMENT

BYTES_PER_ELEMENT: 8

Size (in bytes) of each component.

returns

size of each component

byteLength

byteLength: 16

Length (in bytes) of a complex number.

returns

byte length

im

im: number

Read-only property returning the imaginary component.

returns

imaginary component

re

re: number

Read-only property returning the real component.

returns

real component

Methods

toJSON

  • toJSON(): any
  • Serializes a complex number as a JSON object.

    Notes

    • JSON.stringify() implicitly calls this method when stringifying a Complex128 instance.

    Returns any

    serialized complex number

    Example

    var z = new Complex128( 5.0, 3.0 );
    
    var obj = z.toJSON();
    // returns { 'type': 'Complex128', 're': 5.0, 'im': 3.0 }

toString

  • toString(): string