The R Project SVN R

Rev

Rev 68947 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68947 Rev 77685
Line 42... Line 42...
42
 
42
 
43
#include "nmath.h"
43
#include "nmath.h"
44
 
44
 
45
double rgeom(double p)
45
double rgeom(double p)
46
{
46
{
47
    if (!R_FINITE(p) || p <= 0 || p > 1) ML_ERR_return_NAN;
47
    if (!R_FINITE(p) || p <= 0 || p > 1) ML_WARN_return_NAN;
48
 
48
 
49
    return rpois(exp_rand() * ((1 - p) / p));
49
    return rpois(exp_rand() * ((1 - p) / p));
50
}
50
}