Under Unix, making in this directory will make standalone libraries
libRmath.a and libRmath.so.  `make archive' and `make shared' make
just one of them.

You may find you need GNU make, especially if builddir != srcdir.

Under Windows, use make -f Makefile.win. This makes Rmath.dll with
import library libRmath.a.


To use the routines in your own C programs, include

#define MATHLIB_STANDALONE
#include "R_ext/Mathlib.h"

and link against -lRmath.  The example test.c does nothing useful,
but is provided to test the process.


A little care is needed to use the random-number routines. You will
need to supply the uniform random number generator 

    double unif_rand(void)

or use the one supplied (and with a shared library or DLL you will
have to use the one supplied, which is the Marsaglia-multicarry with
an entry point

    set_seed(unsigned int, unsigned int)

to set its seeds).

The facilties to change the normal random number generator are
available through the constant N01_kind. This takes values
from the enumeration type

typedef enum {
    KINDERMAN_RAMAGE,
    AHRENS_DIETER,
    BOX_MULLER
} N01type;

(and USER_NORM is not available).


There is full access to R's handling of NaNs, Inf and -Inf via special
versions of the macros and functions

    ISNAN, R_FINITE, R_log, R_pow and R_pow_di

and (extern) constants R_PosInf, R_NegInf and NA_REAL. These
facilities work best on IEEE 754 machines, but are available for all.

There is no support for R's notion of missing values, in particular
not for NA_INTEGER nor the distinction between NA and NaN for doubles.