math::complex +linux +x86_64

Index

Types

type c128;
type c64;
type complex;

Functions

fn absc128(c128) f64;
fn acosc128(c128) c128;
fn acoshc128(c128) c128;
fn addc128(c128, c128) c128;
fn addc64(c64, c64) c64;
fn argc128(c128) f64;
fn asinc128(c128) c128;
fn asinhc128(c128) c128;
fn c128to64(c128) c64;
fn c64to128(c64) c128;
fn conjc128(c128) c128;
fn conjc64(c64) c64;
fn cosc128(c128) c128;
fn coshc128(c128) c128;
fn divc128(c128, c128) c128;
fn divc64(c64, c64) c64;
fn equal(complex, complex) bool;
fn equalc128(c128, c128) bool;
fn equalc64(c64, c64) bool;
fn expc128(c128) c128;
fn isinf(c128) bool;
fn isnan(c128) bool;
fn logc128(c128) c128;
fn mulc128(c128, c128) c128;
fn mulc64(c64, c64) c64;
fn negc128(c128) c128;
fn negc64(c64) c64;
fn polarc128(c128) (f64, f64);
fn powc128(c128, c128) c128;
fn projc128(c128) c128;
fn projc64(c64) c64;
fn rectc128(f64, f64) c128;
fn sinc128(c128) c128;
fn sinhc128(c128) c128;
fn sqrtc128(c128) c128;
fn subc128(c128, c128) c128;
fn subc64(c64, c64) c64;

Types

type c128[link]

type c128 = (f64, f64);

A complex number containing a real component and an imaginary component, represented as two double-precision floating point numbers.

type c64[link]

type c64 = (f32, f32);

A complex number containing a real component and an imaginary component, represented as two single-precision floating point numbers.

type complex[link]

type complex = (c64 | c128);

A tagged union of all complex types.

Functions

fn absc128[link]

fn absc128(z: c128) f64;

Takes the absolute value of a complex number.

fn acosc128[link]

fn acosc128(z: c128) c128;

Returns the arccosine, in radians, of z.

fn acoshc128[link]

fn acoshc128(z: c128) c128;

Returns the inverse hyperbolic cosine of z.

fn addc128[link]

fn addc128(a: c128, b: c128) c128;

Adds two complex numbers.

fn addc64[link]

fn addc64(a: c64, b: c64) c64;

Adds two complex numbers

fn argc128[link]

fn argc128(z: c128) f64;

Gets the argument, or phase, of a complex number.

fn asinc128[link]

fn asinc128(z: c128) c128;

Returns the arcsine, in radians, of z.

fn asinhc128[link]

fn asinhc128(z: c128) c128;

Returns the inverse hyperbolic sine of z.

fn c128to64[link]

fn c128to64(z: c128) c64;

Truncates a c128 to a c64. Precision may be lost.

fn c64to128[link]

fn c64to128(z: c64) c128;

Converts a c64 to a c128.

fn conjc128[link]

fn conjc128(z: c128) c128;

Takes the conjugate of a complex number by negating the imaginary component.

fn conjc64[link]

fn conjc64(z: c64) c64;

Takes the conjugate of a complex number by negating the imaginary component.

fn cosc128[link]

fn cosc128(z: c128) c128;

Returns the cosine of z, in radians.

fn coshc128[link]

fn coshc128(z: c128) c128;

Returns the hyperbolic cosine of z.

fn divc128[link]

fn divc128(a: c128, b: c128) c128;

Divides two complex numbers.

fn divc64[link]

fn divc64(a: c64, b: c64) c64;

Divides two complex numbers.

fn equal[link]

fn equal(a: complex, b: complex) bool;

Checks if two complex numbers are equal. Be sure to take floating point round-off errors into account.

fn equalc128[link]

fn equalc128(a: c128, b: c128) bool;

Checks if two complex numbers are equal. Be sure to take floating point round-off errors into account.

fn equalc64[link]

fn equalc64(a: c64, b: c64) bool;

Checks if two complex numbers are equal. Be sure to take floating point round-off errors into account.

fn expc128[link]

fn expc128(z: c128) c128;

Returns math::E raised to the power of z.

fn isinf[link]

fn isinf(z: c128) bool;

Returns true if the given complex number is infinite.

fn isnan[link]

fn isnan(z: c128) bool;

Returns true if the given complex number is NaN.

fn logc128[link]

fn logc128(z: c128) c128;

Returns the natural logarithm of z.

fn mulc128[link]

fn mulc128(a: c128, b: c128) c128;

Multiplies two complex numbers.

fn mulc64[link]

fn mulc64(a: c64, b: c64) c64;

Multiplies two complex numbers.

fn negc128[link]

fn negc128(z: c128) c128;

Negates z.

fn negc64[link]

fn negc64(z: c64) c64;

Negates z.

fn polarc128[link]

fn polarc128(z: c128) (f64, f64);

Returns the polar coordinates of z.

fn powc128[link]

fn powc128(a: c128, b: c128) c128;

Returns a raised to the power of b.

fn projc128[link]

fn projc128(z: c128) c128;

Projects z onto the surface of a Riemann Sphere. If z is finite, it projects to itself. If z is infinite, it projects to positive infinity on the real axis.

fn projc64[link]

fn projc64(z: c64) c64;

Projects z onto the surface of a Riemann Sphere. If z is finite, it projects to itself. If z is infinite, it projects to positive infinity on the real axis.

fn rectc128[link]

fn rectc128(r: f64, theta: f64) c128;

Creates a new c128 from the polar coordinates (r, theta).

fn sinc128[link]

fn sinc128(z: c128) c128;

Returns the sine of z, in radians.

fn sinhc128[link]

fn sinhc128(z: c128) c128;

Returns the hyperbolic sine of z.

fn sqrtc128[link]

fn sqrtc128(z: c128) c128;

Returns the square root of z.

fn subc128[link]

fn subc128(a: c128, b: c128) c128;

Subtracts two complex numbers.

fn subc64[link]

fn subc64(a: c64, b: c64) c64;

Subtracts two complex numbers.