| NEWS | R Documentation |
Rmpfr News
Changes in version 1.1-2 [2025-10-21, r437]
NEW FEATURES
New
.mpfrSizeof()providing the small integersizes of the platform's MPFR library configuration.
BUG FIXES
For
mpfr(x, precBits=*)it is now documented thatprecBitsmust not be larger than largest integer, i.e.,2^31 - 1 = 2147483648. An error message for larger valuesis now easier to understand.Correct ‘configure.ac’, ‘Makevars’, etc needed whenMPFR 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 callingdgamma(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 viaigamma(), to becomemore visible to probability and statistics.
Note that in some regions of its domain, it is currently severelylimited (both slow and inaccurate)as by its implementation in MPFR, see the ‘Warning’ in?igamma.
BUG FIXES
The default for our
dbinom()'suseLogargumentwas determined alone byany(abs(x) > 1e6); it is now alsotrue, for smallerxand largesizeor extremeprob, e.g., indbinom(7L, mpfr(1e10, 96), prob = 1/4).Notably a bad thinko has been fixed which lead to only double precision accuracyresults for
useLog = TRUE.
Misc
Requiring MPFR >= 3.2.0 such that
gamma_inc()isavailable for ourigamma()andpgamma().
Changes in version 1.0-0 [2024-11-15, r422]
USER-VISIBLE CHANGES
The low-level bug fix about conversion has slightly changed theABI and the low-level
validitymethod on Windows: Non-finitempfr-numbers, e.g.,NA,Inf, now have differentmantissa slot@ d, now starting with0Linstead ofpreviously-1L.
NEW FEATURES
New
num2bigq(x)finds “small” denominatorbigq/ ‘bigRational’ approximation to numeric or <mpfr>x.Basically aMASS::fractions()version forRmpfr andgmp.
BUG FIXES
format(mpfr())no longer warns.in
formatDec(): usep*log(2, 10)instead oflog(2^p, 10)!low-level C fixes in ‘src/convert.c’ thanks to analysisand 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()inR 4.4.0 and later.
Changes in version 0.9-5 [2024-01-20, r407]
NEW FEATURES
New
.mpfr2bigq(m)transforms <mpfr>-number vectors tobig rational akabigqones (from packagegmp).New low-level utility functions
.mpfr2d()and.mpfr2i().
BUG FIXES
x == yand other comparisons of two"mpfr"operands now returnNaNwhen an operand isNaN(mpfrnumbers are neverNA).dbinom(x, *)anddnbinom(x, *)now use theprecision 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, asR'schoose()and whenais integer valued, may usethe equivalent ofchooseMpfr(a, a-n)whena-n < nto bemore 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 damageR's internalFALSE 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 asbaseformat.default(); accidentally it had thesign of the number interpreted differently and failed to usee.g.,getOption("scipen")correctly.
NEW FEATURES
log(<mpfr>, base=10)now works.
BUG FIXES
igamma(),hypot(), andatan2()no longeronly return 53 bit (or more generally, mpfr default precision)results.New
max2_prec()utility instead ofimax2(),also curing compilation warning.Internal (exported) objects are now (somewhat) documented, aseventually required byR.
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 tounirootR()adopting its addition in baseRuniroot().
Also add an optionalverbDigitsargument only used in caseverboseis true.New
qnormI(), the normal quantile function, computed viainversion of (our potentially arbitrarily accurate)pnorm(),usingunirootR()root finding.sapplyMpfr()getsdrop_1_ = TRUEoption,changing default behaviour to return an"mpfr"vectorinstead of a 1-column"mpfrMatrix".
BUG FIXES
sapplyMpfr()now gets the correct dimension when it returnsan"mpfrMatrix"(or"*array").Fix
\eqn{(\gamma)}{}- as requested by KH (June 9)..mpfr_gmp_numbbits()is documented now (notably as Isee it is only 32 on Winbuilder (!)).
Changes in version 0.8-9 [2022-06-02, r363]
BUG FIXES
Embarrassing thinko in
dpois(inuseLog=TRUEcase) fixed.
Changes in version 0.8-8 [2022-06-01, r362]
NEW FEATURES
Our “mpfr-ized”
all.equal()is now based onhiddenall.equalMpfr()which uses a smart defaulttolerancefor all methods, and shows much less digits if thereare differences (compatibly toall.equal.numeric()).
BUG FIXES
Our
dpois(x, lambda, *)now worksR-compatibly forlambda=+Infgiving 0 or-Infwhenlog=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 allocatebut never use nor freerr- fixing YAL (yet another leak).
Changes in version 0.8-6 [2021-10-08, r351]
BUG FIXES
In ‘convert.c’'s
R_mpfr_frexp(), dompfr_clear(*), fixing a valgrind-detectable leak.additionally use single mpfr_exp_t and its pointer (and assignto 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, ..); noncentralityncpnot yet supported.New arithmetic functions
frexpMpfr()andldexpMpfr(), corresponding to C's (and CRAN packageDPQ's)ldexp()andfrexp()functions.sapplyMpfr()now also returns"mpfrMatrix"or"mpfrArray"when appropriate.
BUG FIXES
Improved
`[.Ncharacter`method forformatHex()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 sametest as definesuseLog's default.The default method of
mpfr(r)now also works whenris alistof"mpfr1"objects, e.g., resultingfromVectorize(.)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 theyget a new optional argumentuseLog(with a smart default) inorder to choose log-scale computation also forlog=FALSE.
BUG FIXES
For arithmetic (
`+`,`*`, etc), the check to seeif a numeric can be validly coerced to a long has been amended suchthat 9223372036854775808 is no longer accidentally coerced intonegative.dpois(x, lambda)now works via log-scale in caseexp(-lambda)orlambda^xwould under- or overflow evenfor mpfr-numnbers.Analogously,
dbinom()anddnbinom()work via log-scalein 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(), andtcrossprod()), i.e.,.matmult.R(x, y, *)(not exported), gets new optional argumentsfPrec = 1andprecBits, which defaults to the maximum ofgetPrec(x)andgetPrec(y).To get correctcrossprod()and tcrossprod() generics (with aformal...argument), need a newgmp release, aswe get these two generics fromgmp.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, ..), whenqis a bigrational, i.e.,of class"bigq"(packagegmp), the computations areexact now, using big rational arithmetic.New
dnbinom()function (with corresponding newconflicts()with thestats package baseRfunction), providing an"mpfr"-number version of the negativebinomial probabilities..mpfr_erange_set()now can setboth exponentrange limits simultaneously, and now returns invisiblyTRUEifthe change succeeded.New
log1mexp()andlog1pexp(), as "from"copula, notably as the vignette has been here, and authoredby 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 zeroand when an experimental version ofstopifnot(*, allow.logical0=FALSE)is used.Our
cbind()andrbind()methods withsignature = "mNumber"now keep and construct column and rownames as the corresponding base functions, obeyingdeparse.level.Fixed "not-yet"-as-cran ‘NOTE’Undeclared packagesdfoptim,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 than3.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 = TRUEwhichadds a"+"before positive exponents when in exponential (aka“scientific”) representation.The
mpfrandmpfrArrayprint()methods geta correspondingdecimal.plusargument with a default that canbe set byoptions(Rmpfr.print.decimal.plus = *)to allowstrict back compatibility where needed.For MPFR (C library) version >= 3.2.0 (not by default in Fedora 30!),provide theincomplete gamma function
igamma(a,x)which is closely related topgamma(x,a), see help page.Now also export S3 method of
unique()for"mpfr",such thatbasefactor(<mpfr>)“works”.
BUG FIXES
formatMpfr()and hence allprint()ing sufferedfrom an integer overflow bug with very large (base 2) exponents..mpfr2str(x, *)is no longer dependent on theorder of the elements inx; consequentlyformat()andprint()may use less digits in case theprecision decreases alongx.adapt to new C compiler default behavior
-fno-common,usingextern #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 shapeparameter where most of the mass is on very smallxnotrepresentable as double precision numbers.Low-level formatting function
.mpfr2str()— called byformat()and henceprint()methods for"mpfr"objects — now finally obeys itsmaybe.fullargument when itisFALSE, internally in C'smpfr2str().
BUG FIXES
pnorm(<large>, log.p=TRUE)no longer underflows much tooearly, thanks to reports by Jerry Lewis.print.mpfrArray()now also uses a finitemax.digitsdefault, preventing, e.g.,cbind(x, y)touse 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 tonot warn onnon-convergence.Provide a
summary()method for"mpfr"numbersclosely modeled aftersummary.defaultfor numeric.mpfr(NULL)now works, returningmpfr(logical()).a simple
sapplyMpfr()function, showing how to workaround the fact thatsapply()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 usesscientific representation, fixing the bug RMH was reporting March17 already.outer()is “imported” from base, so itbehaves as anRmpfr function which dispatches e.g., whencallingtcrossprod().
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 newoptionmax.digitswith default9999for the printmethods, to limit the number of digits printed for high precisionnumbers.
BUG FIXES
For non-“regular” mpfr numbers, the
dslot inthe"mpfr1"representation is now empty instead of“random”. This also eliminates valgrind warnings aboutuninitialized 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 fromformatHex()andformatBin()now“inherit from”"character"formally.They also got a
`[`method, so subsetting shouldwork, including forarrays of these.The
"mpfr"method ofstr()gains optioninternal.
BUG FIXES
when
print()ing mpfr numbers, the result no longer sometimesloses the last digit.dnorm()now works correctly with mpfr numbers;similarlydbinom()anddpois()should work in allcases, now.in ‘NAMESPACE’, also
exportMethods(apply), soSNscan works.print(formatHex(..)),formatBin()andformatDec()now look better and are more correct; the firsttwo get a new optionexpAlignindicating to use the samenumber 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 longercrashes (from inside MPFR).formatDec(mpfr(NA, 7))now works.For non-“regular” mpfr numbers, the
dslot inthe"mpfr1"representation is now empty instead of“random”. This also eliminates valgrind warnings aboutuninitialized 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() withwrong "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 2to 62 (using digits, upper and lower case ASCII letters,62 == 10 + 2*26characters), as this has been in MPFR since version3.0.0 (seempfrVersion), which is hence (implicitly)required forbasegreater than 36.formatMpfr()gets a new argumentbase = 10and canbe 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 ofclass"mpfr".new matrix
norm()for severalkinds.new functions
formatHex()andformatBin()thanks to Rich Heiberger.mpfr(x)also works asinverse 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, *)nolonger needsnames=FALSEto avoid a warning.
BUG FIXES
pnorm(.),j0()and similar special functionsnow preservempfrMatrixandmpfrArrayclasses.similarly,
is.finite()etc keep thedim()ensionality for"mpfrArray"arguments.mpfr("0xabc", base=16)andmpfr("0b101",base=2)and correspondinggetPrec()now give the correctprecBits 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 forregularR 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"objectswerenot 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 awarning happened.pbetaI(x, a,b), the arbitrarily accuratepbeta()computation forintegeraandb,now works for larger(a,b).Newly providing
mpfr-versions ofdbinom(),dpois(), anddnorm().New utility functions
mpfr_default_prec(),.mpfr.minPrec(), etc, to get, check, set default exponentranges and precision.New
sinpi(),cospi()etc, notably forR >= 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()andpmax(), improvingseqMpfr().new
"Math"and"Math2"group methods, notably forround()andsignif().as(. , "integer")now works (via Cmpfr2i).
More details for old versions up to Feb. 2015:
See file ‘ChangeLog’