| NEWS | R Documentation | 
Rmpfr News
Changes in version 1.1-2 [2025-10-21, r437]
NEW FEATURES
- New - .mpfrSizeof()providing the small integer sizes of the platform's MPFR library configuration.
BUG FIXES
- For - mpfr(x, precBits=*)it is now documented that- precBitsmust not be larger than largest integer, i.e.,- 2^31 - 1 = 2147483648. An error message for larger values is now easier to understand.
- 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, r430]
NEW FEATURES
- added - dchisq()for completeness, simply calling- dgamma(x, df/2, scale = 2).
BUG FIXES
-  dgamma()accidentally used double precision instead of "mpfr" in some cases.
Changes in version 1.1-0 [2025-05-08, r426]
NEW FEATURES
- 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
- The default for our - dbinom()'s- useLogargument was determined alone by- any(abs(x) > 1e6); it is now also true, for smaller- xand large- sizeor 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
- Requiring MPFR >= 3.2.0 such that - gamma_inc()is available for our- igamma()and- pgamma().
Changes in version 1.0-0 [2024-11-15, r422]
USER-VISIBLE CHANGES
- The low-level bug fix about conversion has slightly changed the ABI and the low-level - validitymethod on Windows: Non-finite mpfr-numbers, e.g.,- NA,- Inf, now have different mantissa slot- @ d, now starting with- 0Linstead of previously- -1L.
NEW FEATURES
- New - num2bigq(x)finds “small” denominator- bigq/ ‘bigRational’ approximation to numeric or <mpfr>- x. Basically a MASS- ::fractions()version for Rmpfr and gmp.
BUG FIXES
-  format(mpfr())no longer warns.
- in - formatDec(): use- p*log(2, 10)instead of- log(2^p, 10)!
- low-level C fixes in ‘src/convert.c’ thanks to analysis and proposition by Mikael Jagan. Entails update of - validity()for- "mpfr1".
- add - \link[pkg]{...}where needed.
Misc
- 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-20, r407]
NEW FEATURES
- New - .mpfr2bigq(m)transforms <mpfr>-number vectors to big rational aka- bigqones (from package gmp).
- New low-level utility functions - .mpfr2d()and- .mpfr2i().
BUG FIXES
-  x == yand other comparisons of two"mpfr"operands now returnNaNwhen an operand isNaN(mpfr numbers are neverNA).
-  dbinom(x, *)anddnbinom(x, *)now use the precision ofxwhen it is an (integer valued)"mpfr"object, and then notice or even error when precision is lost asxis coerced to integer.
- (erange-related comments in examples) 
-  chooseMpfr(a, n)gives0whenn < 0, as R'schoose()and whenais integer valued, may use the equivalent ofchooseMpfr(a, a-n)whena-n < nto be more accurate and faster.
-  .mpfr2bigz(m)now also works for really largem.
Changes in version 0.9-4 [2023-12-04, r399]
BUG FIXES
- Fixed Windows-only (long = 32 bit) bug; adapt mpfr1-validity() check. 
- allow ‘.Platform$endian != "little" to ’work' in validity(). 
- format ("%ld" etc) fixes in ‘src/utils.c’ 
- fix "lost braces" 
Changes in version 0.9-3 [2023-07-27, r394]
BUG FIXES
-  any()andall()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, r392]
USER-VISIBLE CHANGES
-  formatMpfr()and hence theformat()method for"mpfr"etc now uses ascientific = <number>the same as baseformat.default(); accidentally it had the sign of the number interpreted differently and failed to use e.g.,getOption("scipen")correctly.
NEW FEATURES
-  log(<mpfr>, base=10)now works.
BUG FIXES
-  igamma(),hypot(), andatan2()no longer only return 53 bit (or more generally, mpfr default precision) results.
- New - max2_prec()utility instead of- imax2(), also curing compilation warning.
- Internal (exported) objects are now (somewhat) documented, as eventually required by R. 
Changes in version 0.9-1 [2023-01-30, r386]
BUG FIXES
-  ldexpMpfr(f, E)now returns an"mpfr"vector (instead of a"mpfr1").
Changes in version 0.9-0 [2023-01-16, r382]
NEW FEATURES
- Add the - extendInt="*"option to- unirootR()adopting its addition in base R- uniroot().
 Also add an optional- verbDigitsargument only used in case- verboseis true.
- New - qnormI(), the normal quantile function, computed via inversion of (our potentially arbitrarily accurate)- pnorm(), using- unirootR()root finding.
-  sapplyMpfr()getsdrop_1_ = TRUEoption, changing default behaviour to return an"mpfr"vector instead of a 1-column"mpfrMatrix".
BUG FIXES
-  sapplyMpfr()now gets the correct dimension when it returns an"mpfrMatrix"(or"*array").
- Fix - \eqn{(\gamma)}{}- as requested by KH (June 9).
-  .mpfr_gmp_numbbits()is documented now (notably as I see it is only 32 on Winbuilder (!)).
Changes in version 0.8-9 [2022-06-02, r363]
BUG FIXES
- Embarrassing thinko in - dpois(in- useLog=TRUEcase) fixed.
Changes in version 0.8-8 [2022-06-01, r362]
NEW FEATURES
- Our “mpfr-ized” - all.equal()is now based on hidden- all.equalMpfr()which uses a smart default- tolerancefor all methods, and shows much less digits if there are differences (compatibly to- all.equal.numeric()).
BUG FIXES
- Our - dpois(x, lambda, *)now works R-compatibly for- lambda=+Infgiving 0 or- -Infwhen- log=TRUE.
-  formatMpfr(x, scientific=FALSE)now “works”.
Misc
-  ‘man/*.Rd’: get rid of some \escapes (needed in past; wrong now)
Changes in version 0.8-7 [2021-10-27, r353]
BUG FIXES
- 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-08, r351]
BUG FIXES
- In ‘convert.c’'s - R_mpfr_frexp(), do- mpfr_clear(*), fixing a valgrind-detectable leak.
- 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-05, r349]
NEW FEATURES
- New mpfr-ized - dt(x, df, ..); noncentrality- ncpnot yet supported.
- New arithmetic functions - frexpMpfr()and- ldexpMpfr(), corresponding to C's (and CRAN package DPQ's)- ldexp()and- frexp()functions.
-  sapplyMpfr()now also returns"mpfrMatrix"or"mpfrArray"when appropriate.
BUG FIXES
- Improved - `[.Ncharacter`method for- formatHex()etc.
Misc
- No longer include ‘Rdefines.h’ as it is somewhat deprecated. 
- update both ‘configure{,.ac}’ (for - autoconf 2.71).
Changes in version 0.8-4 [2021-03-24, r341]
NEW FEATURES
-  dpois(x, *)now also gets an explicit optional argumentuseLoginstead of just switching to log-scale by the same test as definesuseLog's default.
- The default method of - mpfr(r)now also works when- ris a- listof- "mpfr1"objects, e.g., resulting from- Vectorize(.)or similar applied to mpfr-vectors.
BUG FIXES
- 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-22, r340]
NEW FEATURES
-  dnbinom(x, *)anddbinom(x, *)now also work whenxis too large to be coerced tointegerand they get a new optional argumentuseLog(with a smart default) in order to choose log-scale computation also forlog=FALSE.
BUG FIXES
- 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.
-  dpois(x, lambda)now works via log-scale in caseexp(-lambda)orlambda^xwould under- or overflow even for mpfr-numnbers.Analogously, dbinom()anddnbinom()work via log-scale in case even mpfr-arithmetic would overflow.
Changes in version 0.8-2 [2020-11-10, r337]
NEW FEATURES
- The workhorse for all matrix multiplication ( - %*%,- crossprod(), and- tcrossprod()), i.e.,- .matmult.R(x, y, *)(not exported), gets new optional arguments- fPrec = 1and- 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.
-  matmult(x,y)is identical tox %*% y, butmatmult()has further optional argumentsfPrecandprecBits, see above.
- New - is.mpfr(x)function; simple, with fast pre-test.
- In - pbetaI(q, ..), when- qis a bigrational, i.e., of class- "bigq"(package gmp), the computations are exact now, using big rational arithmetic.
- New - dnbinom()function (with corresponding new- conflicts()with the stats package base R function), providing an- "mpfr"-number version of the negative binomial probabilities.
-  .mpfr_erange_set()now can set both exponent range limits simultaneously, and now returns invisiblyTRUEif the change succeeded.
- New - log1mexp()and- log1pexp(), as "from" copula, notably as the vignette has been here, and authored by me.
BUG FIXES
-  mpfr(mm)(and similar) now works for"bigq"or"bigz"matrices, thanks to a report by Jerry Lewis.
- Arithmetic and other - "Ops"between- "mpfr"and- "bigq"aka bigrational numbers, now use the “inherent” precision of the bigrational.
-  chooseMpfr(a, n)and similar now “work” whennis of length zero and when an experimental version ofstopifnot(*, allow.logical0=FALSE)is used.
- Our - cbind()and- rbind()methods with- signature = "mNumber"now keep and construct column and row names as the corresponding base functions, obeying- deparse.level.
- Fixed "not-yet"-as-cran ‘NOTE’ Undeclared packages dfoptim, pracma in Rd xrefs. 
Changes in version 0.8-1 [2020-01-14, r323]
BUG FIXES
- 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 [2019-12-05, r321]
USER-VISIBLE CHANGES
- Formatting incl - print()ing by default uses a- "+"after the exponential character (- "e"by default).
NEW FEATURES
- Provide new low-level utilities - .mpfr_formatinfo(),- .mpfr2exp(), and- .mpfr_erange_is_int().
- Renamed low-level utility functions to use - _instead of- .keeping initial- ".", e.g.,- .mpfr.gmp.numbbits()to- .mpfr_gmp_numbbits().
-  formatMpfr()gets a new optionaldecimal.plus = TRUEwhich adds a"+"before positive exponents when in exponential (aka “scientific”) representation.The mpfrandmpfrArrayprint()methods get a correspondingdecimal.plusargument with a default that can be set byoptions(Rmpfr.print.decimal.plus = *)to allow strict back compatibility where needed.
- 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.
- Now also export S3 method of - unique()for- "mpfr", such that base- factor(<mpfr>)“works”.
BUG FIXES
-  formatMpfr()and hence allprint()ing suffered from an integer overflow bug with very large (base 2) exponents.
-  .mpfr2str(x, *)is no longer dependent on the order of the elements inx; consequentlyformat()andprint()may use less digits in case the precision decreases alongx.
- adapt to new C compiler default behavior - -fno-common, using- extern #include <Syms.h>in most ‘*.c’ files.
Changes in version 0.7-3 [2019-08-06, r305]
USER-VISIBLE CHANGES
- Decreased the default for - max.digitsto 999.
NEW FEATURES
- Provide - dgamma(x, shape)version, e.g., for small shape parameter where most of the mass is on very small- xnot representable as double precision numbers.
- Low-level formatting function - .mpfr2str()— called by- format()and hence- print()methods for- "mpfr"objects — now finally obeys its- maybe.fullargument when it is- FALSE, internally in C's- mpfr2str().
BUG FIXES
-  pnorm(<large>, log.p=TRUE)no longer underflows much too early, thanks to reports by Jerry Lewis.
-  print.mpfrArray()now also uses a finitemax.digitsdefault, preventing, e.g.,cbind(x, y)to use too many digits.
Changes in version 0.7-2 [2019-01-18, r299]
BUG FIXES
-  str(<mpfr>)no longer callsformatMpfr(x, digits, *)with adigitsvector of the same length asx(which never worked correctly).
-  seqMpfr(1, length.out=8)now works correctly.
NEW FEATURES
-  unirootR()gets an option to not warn on non-convergence.
- Provide a - summary()method for- "mpfr"numbers closely modeled after- summary.defaultfor numeric.
-  mpfr(NULL)now works, returningmpfr(logical()).
- 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-24, r291]
BUG FIXES
-  formatMpfr()for large low-precision numbers now uses scientific representation, fixing the bug RMH was reporting March 17 already.
-  outer()is “imported” from base, so it behaves as an Rmpfr function which dispatches e.g., when callingtcrossprod().
Changes in version 0.7-0 [2018-01-12, r284]
NEW FEATURES
-  .mpfr2list()andmpfrXport()gain an optionnames(for nicer output).
-  formatMpfr()and theprint()method get a new optionmax.digitswith default9999for the print methods, to limit the number of digits printed for high precision numbers.
BUG FIXES
- For non-“regular” mpfr numbers, the - dslot 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 [2017-05-29, r264], never on CRAN
NEW FEATURES
- The S3 classes - "Hcharacter"and- "Bcharacter"resulting from- formatHex()and- formatBin()now “inherit from”- "character"formally.
- They also got a - `[`method, so subsetting should work, including for- arrays of these.
- The - "mpfr"method of- str()gains option- internal.
BUG FIXES
- when - print()ing mpfr numbers, the result no longer sometimes loses the last digit.
-  dnorm()now works correctly with mpfr numbers; similarlydbinom()anddpois()should work in all cases, now.
- in ‘NAMESPACE’, also - exportMethods(apply), so SNscan works.
-  print(formatHex(..)),formatBin()andformatDec()now look better and are more correct; the first two get a new optionexpAlignindicating to use the same number of digits for exponents (in “scientific” cases).Notably, mpfr(formatBin(mpx))works for morempxobjects (of class"mpfr").
-  format(mpfr(3,7), digits = 1, base = 2)no longer crashes (from inside MPFR).
-  formatDec(mpfr(NA, 7))now works.
- For non-“regular” mpfr numbers, the - dslot 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, r249]
NEW FEATURES
-  head()andtail()methods for"mpfrMatrix".
BUG FIXES
- C-level - mpfr2str()no longer calls S_realloc() with wrong "old size" (thanks to Bill Dunlap).
-  c()now also works when its result is a length-0"mpfr"object.
Changes in version 0.6-0 [2015-12-04, r237]
NEW FEATURES
-  mpfr()now is S3 generic with several methods, notably a"mpfr"method allowing to change precision or rounding mode.
-  mpfr(),formatMpfr(), etc, now work with bases from 2 to 62 (using digits, upper and lower case ASCII letters,62 == 10 + 2*26characters), as this has been in MPFR since version 3.0.0 (seempfrVersion), which is hence (implicitly) required forbasegreater than 36.
-  formatMpfr()gets a new argumentbase = 10and can be used to produce in other bases, notably binary (base = 2) or hexadecimal (base = 16).
-  str(<mpfr>, ....)is now based onformatMpfr()and nicely shows numbers also out of the double precision range.Further, it now chooses a smart default for optional argument vec.len.
-  matrix(mp, ..)now also works whenmpis of class"mpfr".
- new matrix - norm()for several- kinds.
- new functions - formatHex()and- formatBin()thanks to Rich Heiberger.
-  mpfr(x)also works as inverse offormatBinandformatHex.
-  roundMpfr()and mathematical functions such asjn, orchooseMpfr()get new optional argumentrnd.modepassed to the corresponding MPFR function.
-  median(x),mean(x, trim)fortrim > 0now work fine for"mpfr"x, andquantile(x, *)no longer needsnames=FALSEto avoid a warning.
BUG FIXES
-  pnorm(.),j0()and similar special functions now preservempfrMatrixandmpfrArrayclasses.
- similarly, - is.finite()etc keep the- dim()ensionality for- "mpfrArray"arguments.
-  mpfr("0xabc", base=16)andmpfr("0b101", base=2)and correspondinggetPrec()now give the correct precBits instead of too many.
-  str(<0-length mpfr>)now works correctly.
Changes in version 0.5-7 [2014-11-27, r205]
NEW FEATURES
- . 
BUG FIXES
-  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, r203]
NEW FEATURES
- experimental - mpfrImport(),- mpfrXport()utilities – as we found cases, where save()- "mpfr"objects were not portable between different platforms.
-  as(*,"mpfr")now also supports rounding mode"A"(“Away from zero”).
- Several hidden low level utilities also get a - rnd.modeoption.
Changes in version 0.5-5 [2014-06-19, r190]
NEW FEATURES
- The result of - integrateR()now prints even if a warning happened.
-  pbetaI(x, a,b), the arbitrarily accuratepbeta()computation for integeraandb, now works for larger(a,b).
- Newly providing - mpfr-versions of- dbinom(),- dpois(), and- dnorm().
- New utility functions - mpfr_default_prec(),- .mpfr.minPrec(), etc, to get, check, set default exponent ranges and precision.
- New - sinpi(),- cospi()etc, notably for R >= 3.0.1.
Changes in version 0.5-4 [2013-10-22, r173]
NEW FEATURES
- . 
BUG FIXES
- . 
Changes in version 0.1-5 [2009-08-06]
NEW FEATURES
- First CRAN release on 'Publication:' 2009-08-14 20:24:02 
- new - pmin()and- pmax(), improving- seqMpfr().
- new - "Math"and- "Math2"group methods, notably for- round()and- signif().
-  as(. , "integer")now works (via Cmpfr2i).
More details for old versions up to Feb. 2015:
- See file ‘ChangeLog’