Skip to content

Commit

Permalink
Merge pull request #6 from eddelbuettel/master
Browse files Browse the repository at this point in the history
use DBL_EPSILON instead of DOUBLE_EPS to support STRICT_R_HEADERS
  • Loading branch information
YunyiShen authored Aug 1, 2021
2 parents e972789 + 2d85077 commit f2f090a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GIG_helper.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ double rgig(double lambda, double chi, double psi){

// allocate array for random sample //

if (chi < DOUBLE_EPS*10.0) {
if (chi < DBL_EPSILON*10.0) {
// special cases which are basically Gamma and Inverse Gamma distribution //
if (lambda > 0.0) {
res = R::rgamma(lambda, 2.0/psi);
Expand All @@ -343,7 +343,7 @@ double rgig(double lambda, double chi, double psi){
}
}

else if (psi < DOUBLE_EPS*10.0) {
else if (psi < DBL_EPSILON*10.0) {
// special cases which are basically Gamma and Inverse Gamma distribution //
if (lambda > 0.0) {
res = 1.0/R::rgamma(lambda, 2.0/chi);
Expand Down

0 comments on commit f2f090a

Please sign in to comment.