Author image Ralph Schleicher
and 1 contributors


Math::MatrixDecomposition::Util - utility functions


    use Math::MatrixDecomposition::Util qw(:all);


This module contains a colorful collection of utility functions. Nothing is exported by default.

Utility Functions


Return the machine precision.

mod (num, den)

Return the remainder of a division. Any argument can be either an integral number or a floating-point number.

min (a, b)

Return the minimum value of the two arguments.

max (a, b)

Return the maximum value of the two arguments.

sign (a, b)

Return the value of a with the sign of b.

If the second argument b is less than zero, the return value is a non-positive number. Otherwise, the return value is a non-negative number.

hypot (a, b)

Return the length of the hypotenuse of a right triangle. This is equal to the distance of a point to the origin in a two-dimensional Cartesian coordinate system.

cdiv (a_re, a_im, b_re, b_im)

Return the real part and imaginary part of the division of two complex numbers.


Ralph Schleicher <>