next up previous contents
Next: Comparison routines Up: The Common Package Previous: Complex numbers   Contents

Numerical routines

      #include <gandalf/common/numerics.h>
This contains a few useful numerical routines not often included in C libraries, such as square (e.g. gan_sqr_d() or the macro gan_sqr()), cube-root gan_cbrt() and various flavours of random number generators. There are functions gan_solve_quadratic () and gan_solve_cubic() for finding the real and complex roots of quadratic and cubic equations, and also a function gan_normal_sample() for generating samples from a normal distribution.