NEWS | R Documentation |
Rmpfr News
Changes in version 1.1-0 [2024-11-15, r422]
USER-VISIBLE CHANGES
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 with0L
instead of previously-1L
.
NEW FEATURES
New
num2bigq(x)
finds “small” denominatorbigq
/ ‘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()
: usep*log(2, 10)
instead oflog(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 akabigq
ones (from package gmp).New low-level utility functions
.mpfr2d()
and.mpfr2i()
.
BUG FIXES
-
x == y
and other comparisons of two"mpfr"
operands now returnNaN
when an operand isNaN
(mpfr numbers are neverNA
). -
dbinom(x, *)
anddnbinom(x, *)
now use the precision ofx
when it is an (integer valued)"mpfr"
object, and then notice or even error when precision is lost asx
is coerced to integer. (erange-related comments in examples)
-
chooseMpfr(a, n)
gives0
whenn < 0
, as R'schoose()
and whena
is integer valued, may use the equivalent ofchooseMpfr(a, a-n)
whena-n < n
to 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 ofimax2()
, 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 tounirootR()
adopting its addition in base Runiroot()
.
Also add an optionalverbDigits
argument only used in caseverbose
is true.New
qnormI()
, the normal quantile function, computed via inversion of (our potentially arbitrarily accurate)pnorm()
, usingunirootR()
root finding.-
sapplyMpfr()
getsdrop_1_ = TRUE
option, 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
(inuseLog=TRUE
case) fixed.
Changes in version 0.8-8 [2022-06-01, r362]
NEW FEATURES
Our “mpfr-ized”
all.equal()
is now based on hiddenall.equalMpfr()
which uses a smart defaulttolerance
for all methods, and shows much less digits if there are differences (compatibly toall.equal.numeric()
).
BUG FIXES
Our
dpois(x, lambda, *)
now works R-compatibly forlambda=+Inf
giving 0 or-Inf
whenlog=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 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 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, ..)
; noncentralityncp
not yet supported.New arithmetic functions
frexpMpfr()
andldexpMpfr()
, corresponding to C's (and CRAN package DPQ'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 argumentuseLog
instead of just switching to log-scale by the same test as definesuseLog
's default. The default method of
mpfr(r)
now also works whenr
is alist
of"mpfr1"
objects, e.g., resulting fromVectorize(.)
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 whenx
is too large to be coerced tointeger
and 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^x
would 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()
, andtcrossprod()
), i.e.,.matmult.R(x, y, *)
(not exported), gets new optional argumentsfPrec = 1
andprecBits
, which defaults to the maximum ofgetPrec(x)
andgetPrec(y)
. To get correctcrossprod()
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 argumentsfPrec
andprecBits
, see above. New
is.mpfr(x)
function; simple, with fast pre-test.In
pbetaI(q, ..)
, whenq
is a bigrational, i.e., of class"bigq"
(package gmp), the computations are exact now, using big rational arithmetic.New
dnbinom()
function (with corresponding newconflicts()
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 invisiblyTRUE
if the change succeeded. New
log1mexp()
andlog1pexp()
, 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” whenn
is of length zero and when an experimental version ofstopifnot(*, allow.logical0=FALSE)
is used. Our
cbind()
andrbind()
methods withsignature = "mNumber"
now keep and construct column and row names as the corresponding base functions, obeyingdeparse.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
NOTE
s.
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 = TRUE
which adds a"+"
before positive exponents when in exponential (aka “scientific”) representation.The
mpfr
andmpfrArray
print()
methods get a correspondingdecimal.plus
argument 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 topgamma(x,a)
, see help page.Now also export S3 method of
unique()
for"mpfr"
, such that basefactor(<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
, 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.digits
to 999.
NEW FEATURES
Provide
dgamma(x, shape)
version, e.g., for small shape parameter where most of the mass is on very smallx
not representable as double precision numbers.Low-level formatting function
.mpfr2str()
— called byformat()
and henceprint()
methods for"mpfr"
objects — now finally obeys itsmaybe.full
argument when it isFALSE
, internally in C'smpfr2str()
.
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.digits
default, 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 adigits
vector 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 aftersummary.default
for numeric.-
mpfr(NULL)
now works, returningmpfr(logical())
. a simple
sapplyMpfr()
function, showing how to work around 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 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.digits
with default9999
for the print methods, to limit the number of digits printed for high precision numbers.
BUG FIXES
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 [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 should work, including forarray
s of these.The
"mpfr"
method ofstr()
gains optioninternal
.
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 optionexpAlign
indicating to use the same number of digits for exponents (in “scientific” cases).Notably,
mpfr(formatBin(mpx))
works for morempx
objects (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
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, 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*26
characters), as this has been in MPFR since version 3.0.0 (seempfrVersion
), which is hence (implicitly) required forbase
greater than 36. -
formatMpfr()
gets a new argumentbase = 10
and 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 whenmp
is of class"mpfr"
. new matrix
norm()
for severalkind
s.new functions
formatHex()
andformatBin()
thanks to Rich Heiberger.-
mpfr(x)
also works as inverse offormatBin
andformatHex
. -
roundMpfr()
and mathematical functions such asjn
, orchooseMpfr()
get new optional argumentrnd.mode
passed to the corresponding MPFR function. -
median(x)
,mean(x, trim)
fortrim > 0
now work fine for"mpfr"
x, andquantile(x, *)
no longer needsnames=FALSE
to avoid a warning.
BUG FIXES
-
pnorm(.)
,j0()
and similar special functions now preservempfrMatrix
andmpfrArray
classes. similarly,
is.finite()
etc keep thedim()
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.mode
option.
BUG FIXES
.
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 integera
andb
, 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 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()
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’