Skip to main content

Module math

Module math 

Source
Expand description

Mathematics.

  • complex: complex numbers with f32 or f64 parts, their arithmetic with +, -, * and /, and their absolute values, arguments, exponentials, logarithms, square roots and powers.
  • ec: elliptic curves over prime fields in Weierstrass, Montgomery and Edwards form, whose points add with +, subtract with - and multiply by a number with *, and the curves in common use; on numbers, and not constant-time.
  • matrix: matrices of floats, complex numbers or numbers, their arithmetic with +, - and *, transposes, row and column operations, determinants, decompositions, eigenvalues and functions of matrices.
  • numbers: integers of any size, stored as a sign and the bytes of the absolute value in either byte order; they add with + and +=, subtract with - and -=, multiply with * and *=, divide with /, /=, % and %=, shift with <<, >>, <<= and >>=, and are written and read as text in any radix from 2 to 36.

Modules§

complex
Complex numbers: a Complex<T> is re + im·i with parts of the Float type T, f32 or f64.
ec
Elliptic curves over prime fields, with coordinates and scalars that are Numbers.
matrix
Matrices: a Matrix<T> is a rectangular array of elements of the type T, which is f32, f64, Complex<f32>, Complex<f64> or Number.
numbers
Integers of any size: a Number holds the sign of an integer and the bytes of its absolute value, in the ByteOrder it was created with.