Changes in version 1.1-2 (2025-10-27) NEW FEATURES o New .mpfrSizeof() providing the small integer sizes of the platform's MPFR library configuration. BUG FIXES o For mpfr(x, precBits=*) it is now documented that precBits must not be larger than largest integer, i.e., 2^31 - 1 = 2147483648. An error message for larger values is now easier to understand. o Correct configure.ac, Makevars, etc needed when MPFR exponent size does not match limb size (as on r-universe Windows), fixing R-forge Rmpfr bug #6865 by Mikael Jagan. Changes in version 1.1-1 (2025-07-18) NEW FEATURES o added dchisq() for completeness, simply calling dgamma(x, df/2, scale = 2). BUG FIXES o dgamma() accidentally used double precision instead of "mpfr" in some cases. Changes in version 1.1-0 (2025-05-13) NEW FEATURES o New pgamma(), simply via igamma(), to become more visible to probability and statistics. Note that in some regions of its domain, it is currently severely limited (both slow and inaccurate) as by its implementation in MPFR, see the ‘Warning’ in ?igamma. BUG FIXES o The default for our dbinom()'s useLog argument was determined alone by any(abs(x) > 1e6); it is now also true, for smaller x and large size or extreme prob, e.g., in dbinom(7L, mpfr(1e10, 96), prob = 1/4). Notably a bad thinko has been fixed which lead to only double precision accuracy results for useLog = TRUE. Misc o Requiring MPFR >= 3.2.0 such that gamma_inc() is available for our igamma() and pgamma(). Changes in version 1.0-0 (2024-11-18) USER-VISIBLE CHANGES o The low-level bug fix about conversion has slightly changed the ABI and the low-level validity method on Windows: Non-finite mpfr-numbers, e.g., NA, Inf, now have different mantissa slot @ d, now starting with 0L instead of previously -1L. NEW FEATURES o New num2bigq(x) finds “small” denominator bigq / ‘bigRational’ approximation to numeric or x. Basically a MASS::fractions() version for Rmpfr and gmp. BUG FIXES o format(mpfr()) no longer warns. o in formatDec(): use p*log(2, 10) instead of log(2^p, 10)! o low-level C fixes in src/convert.c thanks to analysis and proposition by Mikael Jagan. Entails update of validity() for "mpfr1". o add \link[pkg]{...} where needed. Misc o new ../tests/special-fun-dgamma.R file; partly from ..../special-fun-ex.R: accuracy checking for more accurate stirlerr() in R 4.4.0 and later. Changes in version 0.9-5 (2024-01-21) NEW FEATURES o New .mpfr2bigq(m) transforms -number vectors to big rational aka bigq ones (from package gmp). o New low-level utility functions .mpfr2d() and .mpfr2i(). BUG FIXES o x == y and other comparisons of two "mpfr" operands now return NaN when an operand is NaN (mpfr numbers are never NA). o dbinom(x, *) and dnbinom(x, *) now use the precision of x when it is an (integer valued) "mpfr" object, and then notice or even error when precision is lost as x is coerced to integer. o (erange-related comments in examples) o chooseMpfr(a, n) gives 0 when n < 0, as R's choose() and when a is integer valued, may use the equivalent of chooseMpfr(a, a-n) when a-n < n to be more accurate and faster. o .mpfr2bigz(m) now also works for really large m. Changes in version 0.9-4 (2023-12-04) BUG FIXES o Fixed Windows-only (long = 32 bit) bug; adapt mpfr1-validity() check. o allow `.Platform$endian != "little" to 'work' in validity(). o format ("%ld" etc) fixes in src/utils.c o fix "lost braces" Changes in version 0.9-3 (2023-08-08) BUG FIXES o any() and all() no longer damage R's internal FALSE or TRUE, fixing R-forge Rmpfr bug #6764 by Andrew Manderson. Changes in version 0.9-2 (2023-04-21) USER-VISIBLE CHANGES o formatMpfr() and hence the format() method for "mpfr" etc now uses a scientific = the same as base format.default(); accidentally it had the _sign_ of the number interpreted differently and failed to use e.g., getOption("scipen") correctly. NEW FEATURES o log(, base=10) now works. BUG FIXES o igamma(), hypot(), and atan2() no longer only return 53 bit (or more generally, mpfr default precision) results. o New max2_prec() utility instead of imax2(), also curing compilation warning. o Internal (exported) objects are now (somewhat) documented, as eventually required by R. Changes in version 0.9-1 (2023-01-31) BUG FIXES o ldexpMpfr(f, E) now returns an "mpfr" vector (instead of a "mpfr1"). Changes in version 0.9-0 (2023-01-16) NEW FEATURES o Add the extendInt="*" option to unirootR() adopting its addition in base R uniroot(). Also add an optional verbDigits argument only used in case verbose is true. o New qnormI(), the normal quantile function, computed via inversion of (our potentially arbitrarily accurate) pnorm(), using unirootR() root finding. o sapplyMpfr() gets drop_1_ = TRUE option, _changing_ default behaviour to return an "mpfr" vector instead of a 1-column "mpfrMatrix". BUG FIXES o sapplyMpfr() now gets the correct dimension when it returns an "mpfrMatrix" (or "*array"). o Fix \eqn{(\gamma)}{} - as requested by KH (June 9). o .mpfr_gmp_numbbits() is documented now (notably as I see it is only 32 on Winbuilder (!)). Changes in version 0.8-9 (2022-06-03) BUG FIXES o Embarrassing thinko in dpois (in useLog=TRUE case) fixed. Changes in version 0.8-8 (2022-06-02) NEW FEATURES o Our “mpfr-ized” all.equal() is now based on hidden all.equalMpfr() which uses a smart default tolerance for all methods, and shows much less digits if there are differences (compatibly to all.equal.numeric()). BUG FIXES o Our dpois(x, lambda, *) now works R-compatibly for lambda=+Inf giving 0 or -Inf when log=TRUE. o formatMpfr(x, scientific=FALSE) now “works”. Misc o man/*.Rd: get rid of some \ escapes (needed in past; wrong now) Changes in version 0.8-7 (2021-10-28) BUG FIXES o In Ops.c's R_mpfr_mod(), no longer allocate but never use nor free rr - fixing YAL (yet another leak). Changes in version 0.8-6 (2021-10-25) BUG FIXES o In convert.c's R_mpfr_frexp(), do mpfr_clear(*), fixing a valgrind-detectable leak. o additionally use single mpfr_exp_t and its pointer (and assign to R allocated vector inside main loop, fixing a valgrind "unitialized value" case. Changes in version 0.8-5 (2021-10-06) NEW FEATURES o New mpfr-ized dt(x, df, ..); noncentrality ncp not yet supported. o New arithmetic functions frexpMpfr() and ldexpMpfr(), corresponding to C's (and CRAN package DPQ's) ldexp() and frexp() functions. o sapplyMpfr() now also returns "mpfrMatrix" or "mpfrArray" when appropriate. BUG FIXES o Improved `[.Ncharacter` method for formatHex() etc. Misc o No longer include Rdefines.h as it is somewhat deprecated. o update both configure{,.ac} (for autoconf 2.71). Changes in version 0.8-4 (2021-04-11) NEW FEATURES o dpois(x, *) now also gets an explicit optional argument useLog instead of just switching to log-scale by the same test as defines useLog's default. o The default method of mpfr(r) now also works when r is a list of "mpfr1" objects, e.g., resulting from Vectorize(.) or similar applied to mpfr-vectors. BUG FIXES o fixed problem detected by clang-UBSAN testing in src/Ops.c (from arithmetic bug fix in 0.8-3). Changes in version 0.8-3 (2021-03-23) NEW FEATURES o dnbinom(x, *) and dbinom(x, *) now also work when x is too large to be coerced to integer _and_ they get a new optional argument useLog (with a smart default) in order to choose log-scale computation also for log=FALSE. BUG FIXES o For arithmetic (`+`, `*`, etc), the check to see if a numeric can be validly coerced to a long has been amended such that 9223372036854775808 is no longer accidentally coerced into _negative_. o dpois(x, lambda) now works via log-scale in case exp(-lambda) or lambda^x would under- or overflow even for mpfr-numnbers. Analogously, dbinom() and dnbinom() work via log-scale in case even mpfr-arithmetic would overflow. Changes in version 0.8-2 (2020-11-11) NEW FEATURES o The workhorse for all matrix multiplication (%*%, crossprod(), and tcrossprod()), i.e., .matmult.R(x, y, *) (not exported), gets new optional arguments fPrec = 1 and precBits, which defaults to the maximum of getPrec(x) and getPrec(y). To get correct crossprod() and tcrossprod() generics (with a formal ... argument), need a new gmp release, as we get these two generics from gmp. o matmult(x,y) is identical to x %*% y, but matmult() has further optional arguments fPrec and precBits, see above. o New is.mpfr(x) function; simple, with fast pre-test. o In pbetaI(q, ..), when q is a bigrational, i.e., of class "bigq" (package gmp), the computations are _exact_ now, using big rational arithmetic. o New dnbinom() function (with corresponding new conflicts() with the stats package base R function), providing an "mpfr"-number version of the negative binomial probabilities. o .mpfr_erange_set() now can set _both_ exponent range limits simultaneously, and now returns invisibly TRUE if the change succeeded. o New log1mexp() and log1pexp(), as "from" copula, notably as the vignette has been here, and authored by me. BUG FIXES o mpfr(mm) (and similar) now works for "bigq" or "bigz" matrices, thanks to a report by Jerry Lewis. o Arithmetic and other "Ops" between "mpfr" and "bigq" aka bigrational numbers, now use the “inherent” precision of the bigrational. o chooseMpfr(a, n) and similar now “work” when n is of length zero _and_ when an experimental version of stopifnot(*, allow.logical0=FALSE) is used. o Our cbind() and rbind() methods with signature = "mNumber" now keep and construct column and row names as the corresponding base functions, obeying deparse.level. o Fixed "not-yet"-as-cran NOTE _Undeclared packages dfoptim, pracma in Rd xrefs_. Changes in version 0.8-1 (2020-01-24) BUG FIXES o Provide dummy C function in the case MPFR library is older than 3.2.0, thanks to Brian Ripley. Should work around check NOTEs. Changes in version 0.8-0 USER-VISIBLE CHANGES o Formatting incl print()ing by default uses a "+" after the exponential character ("e" by default). NEW FEATURES o Provide new low-level utilities .mpfr_formatinfo(), .mpfr2exp(), and .mpfr_erange_is_int(). o Renamed low-level utility functions to use _ instead of . keeping initial ".", e.g., .mpfr.gmp.numbbits() to .mpfr_gmp_numbbits(). o formatMpfr() gets a new optional decimal.plus = TRUE which adds a "+" before positive exponents when in exponential (aka “scientific”) representation. The mpfr and mpfrArray print() methods get a corresponding decimal.plus argument with a default that can be set by options(Rmpfr.print.decimal.plus = *) to allow strict back compatibility where needed. o For MPFR (C library) version >= 3.2.0 (not by default in Fedora 30!), provide the _incomplete_ gamma function igamma(a,x) which is closely related to pgamma(x,a), see help page. o Now also export S3 method of unique() for "mpfr", such that base factor() “works”. BUG FIXES o formatMpfr() and hence all print()ing suffered from an integer overflow bug with very large (base 2) exponents. o .mpfr2str(x, *) is no longer dependent on the _order_ of the elements in x; consequently format() and print() may use less digits in case the precision decreases along x. o adapt to new C compiler default behavior -fno-common, using extern #include in most *.c files. Changes in version 0.7-3 USER-VISIBLE CHANGES o Decreased the default for max.digits to 999. NEW FEATURES o Provide dgamma(x, shape) version, e.g., for small shape parameter where most of the mass is on very small x not representable as double precision numbers. o Low-level formatting function .mpfr2str() - called by format() and hence print() methods for "mpfr" objects - now finally obeys its maybe.full argument when it is FALSE, internally in C's mpfr2str(). BUG FIXES o pnorm(, log.p=TRUE) no longer underflows much too early, thanks to reports by Jerry Lewis. o print.mpfrArray() now also uses a finite max.digits default, preventing, e.g., cbind(x, y) to use too many digits. Changes in version 0.7-2 (2019-01-22) BUG FIXES o str() no longer calls formatMpfr(x, digits, *) with a digits _vector_ of the same length as x (which never worked correctly). o seqMpfr(1, length.out=8) now works correctly. NEW FEATURES o unirootR() gets an option to _not_ warn on non-convergence. o Provide a summary() method for "mpfr" numbers closely modeled after summary.default for numeric. o mpfr(NULL) now works, returning mpfr(logical()). o a simple sapplyMpfr() function, showing how to work around the fact that sapply() does typically not work with "mpfr" numbers. Changes in version 0.7-1 (2018-07-30) BUG FIXES o formatMpfr() for large low-precision numbers now uses scientific representation, fixing the bug RMH was reporting March 17 already. o outer() is “imported” from base, so it behaves as an Rmpfr function which dispatches e.g., when calling tcrossprod(). Changes in version 0.7-0 (2018-01-12) NEW FEATURES o .mpfr2list() and mpfrXport() gain an option names (for nicer output). o formatMpfr() and the print() method get a new option max.digits with default 9999 for the print methods, to limit the number of digits printed for high precision numbers. BUG FIXES o For non-“regular” mpfr numbers, the d slot in the "mpfr1" representation is now empty instead of “random”. This also eliminates valgrind warnings about uninitialized values in C. Changes in version 0.6-2 NEW FEATURES o The S3 classes "Hcharacter" and "Bcharacter" resulting from formatHex() and formatBin() now “inherit from” "character" formally. o They also got a `[` method, so subsetting should work, including for arrays of these. o The "mpfr" method of str() gains option internal. BUG FIXES o when print()ing mpfr numbers, the result no longer sometimes loses the last digit. o dnorm() now works correctly with mpfr numbers; similarly dbinom() and dpois() should work in all cases, now. o in NAMESPACE, also exportMethods(apply), so SNscan works. o print(formatHex(..)), formatBin() and formatDec() now look better and are more correct; the first two get a new option expAlign indicating to use the same number of digits for exponents (in “scientific” cases). Notably, mpfr(formatBin(mpx)) works for more mpx objects (of class "mpfr"). o format(mpfr(3,7), digits = 1, base = 2) no longer crashes (from inside MPFR). o formatDec(mpfr(NA, 7)) now works. o For non-“regular” mpfr numbers, the d slot in the "mpfr1" representation is now empty instead of “random”. This also eliminates valgrind warnings about uninitialized values in C. Changes in version 0.6-1 (2016-11-15) NEW FEATURES o head() and tail() methods for "mpfrMatrix". BUG FIXES o C-level mpfr2str() no longer calls S_realloc() with wrong "old size" (thanks to Bill Dunlap). o c() now also works when its result is a length-0 "mpfr" object. Changes in version 0.6-0 (2015-12-04) NEW FEATURES o mpfr() now is S3 generic with several methods, notably a "mpfr" method allowing to change precision or rounding mode. o mpfr(), formatMpfr(), etc, now work with bases from 2 to 62 (using digits, upper and lower case ASCII letters, 62 == 10 + 2*26 characters), as this has been in MPFR since version 3.0.0 (see mpfrVersion), which is hence (implicitly) required for base greater than 36. o formatMpfr() gets a new argument base = 10 and can be used to produce in other bases, notably binary (base = 2) or hexadecimal (base = 16). o str(, ....) is now based on formatMpfr() and nicely shows numbers also out of the double precision range. Further, it now chooses a smart default for optional argument vec.len. o matrix(mp, ..) now also works when mp is of class "mpfr". o new matrix norm() for several kinds. o new functions formatHex() and formatBin() thanks to Rich Heiberger. o mpfr(x) also works as _inverse_ of formatBin and formatHex. o roundMpfr() and mathematical functions such as jn, or chooseMpfr() get new optional argument rnd.mode passed to the corresponding MPFR function. o median(x), mean(x, trim) for trim > 0 now work fine for "mpfr" x, and quantile(x, *) no longer needs names=FALSE to avoid a warning. BUG FIXES o pnorm(.), j0() and similar special functions now preserve mpfrMatrix and mpfrArray classes. o similarly, is.finite() etc keep the dim()ensionality for "mpfrArray" arguments. o mpfr("0xabc", base=16) and mpfr("0b101", base=2) and corresponding getPrec() now give the correct precBits instead of too many. o str(<0-length mpfr>) now works correctly. Changes in version 0.5-7 (2014-11-27) NEW FEATURES o . BUG FIXES o as.integer() now rounds “to zero” as for regular R numbers (it accidentally did round “to nearest” previously). Changes in version 0.5-6 (2014-09-05) NEW FEATURES o experimental mpfrImport(), mpfrXport() utilities - as we found cases, where save() "mpfr" objects were _not_ portable between different platforms. o as(*,"mpfr") now also supports rounding mode "A" (“*A*way from zero”). o Several hidden low level utilities also get a rnd.mode option. Changes in version 0.5-5 (2014-06-19) NEW FEATURES o The result of integrateR() now prints even if a warning happened. o pbetaI(x, a,b), the arbitrarily accurate pbeta() computation for _integer_ a and b, now works for larger (a,b). o Newly providing mpfr-versions of dbinom(), dpois(), and dnorm(). o New utility functions mpfr_default_prec(), .mpfr.minPrec(), etc, to get, check, set default exponent ranges and precision. o New sinpi(), cospi() etc, notably for R >= 3.0.1. Changes in version 0.5-4 (2013-10-23) NEW FEATURES o . BUG FIXES o . Changes in version 0.1-5 (2009-08-14) NEW FEATURES o First CRAN release on 'Publication:' 2009-08-14 20:24:02 o new pmin() and pmax(), improving seqMpfr(). o new "Math" and "Math2" group methods, notably for round() and signif(). o as(. , "integer") now works (via C mpfr2i). More details for old versions up to Feb. 2015: o See file ChangeLog