Skip to content

Commit

Permalink
no installation warnings for new or old MPFR
Browse files Browse the repository at this point in the history
  • Loading branch information
hkumar6 committed Sep 2, 2019
1 parent 7c98e38 commit 3dc2914
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
sudo: required
dist: trusty
language: r
r_binary_packages:
- Rcpp
Expand Down
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Test environments
* Linux
- R 3.2.3
- R 3.6.1
- apt packages: build-essential, libmpfr-dev, libblas-dev, liblapack-dev
* Windows
- R 3.4.1, R 3.5.2
Expand All @@ -9,7 +9,7 @@
- R 3.5.3
- brew packages: mpfr
* Travis-CI
- R 3.5.2 (Linux)
- R 3.5.2, libmpfr-dev_3.1.2-1 (Linux)
- R 3.5.3 (OS X)

## R CMD check results
Expand Down
9 changes: 8 additions & 1 deletion src/mpreal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2198,8 +2198,11 @@ inline const mpreal sqrt(const int v, mp_rnd_t rnd_mode)
inline const mpreal root(const mpreal& x, unsigned long int k, mp_rnd_t r = mpreal::get_default_rnd())
{
mpreal y(0, mpfr_get_prec(x.mpfr_srcptr()));
//mpfr_root(y.mpfr_ptr(), x.mpfr_srcptr(), k, r);
#if MPFR_VERSION_MAJOR >= 4
mpfr_rootn_ui(y.mpfr_ptr(), x.mpfr_ptr(), k, r);
#else
mpfr_root(y.mpfr_ptr(), x.mpfr_srcptr(), k, r);
#endif
return y;
}

Expand Down Expand Up @@ -2644,7 +2647,11 @@ inline const mpreal random(unsigned int seed = 0)
inline const mpreal grandom (gmp_randstate_t& state, mp_rnd_t rnd_mode = mpreal::get_default_rnd())
{
mpreal x;
#if MPFR_VERSION_MAJOR >= 4
mpfr_nrandom(x.mpfr_ptr(), state, rnd_mode);
#else
mpfr_grandom(x.mpfr_ptr(), NULL, state, rnd_mode);
#endif
return x;
}

Expand Down

0 comments on commit 3dc2914

Please sign in to comment.