NEWS | R Documentation |
.
any()
and all()
no longer damage R's internal
FALSE or TRUE, fixing R-forge Rmpfr bug #6764 by Andrew Manderson.
formatMpfr()
and hence the format()
method for
"mpfr"
etc now uses a scientific = <number>
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.
log(<mpfr>, base=10)
now works.
igamma()
, hypot()
, and atan2()
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.
ldexpMpfr(f, E)
now returns an "mpfr"
vector
(instead of a "mpfr1"
).
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.
New qnormI()
, the normal quantile function, computed via
inversion of (our potentially arbitrarily accurate) pnorm()
,
using unirootR()
root finding.
sapplyMpfr()
gets drop_1_ = TRUE
option,
changing default behaviour to return an "mpfr"
vector
instead of a 1-column "mpfrMatrix"
.
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 (!)).
Embarrassing thinko in dpois
(in useLog=TRUE
case) fixed.
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()
).
Our dpois(x, lambda, *)
now works R-compatibly for
lambda=+Inf
giving 0 or -Inf
when log=TRUE
.
formatMpfr(x, scientific=FALSE)
now “works”.
‘man/*.Rd’: get rid of some \
escapes (needed in past; wrong now)
In ‘Ops.c’'s R_mpfr_mod()
, no longer allocate
but never use nor free rr
- fixing YAL (yet another leak).
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.
New mpfr-ized dt(x, df, ..)
; noncentrality ncp
not 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.
Improved `[.Ncharacter`
method for formatHex()
etc.
No longer include ‘Rdefines.h’ as it is somewhat deprecated.
update ‘configure.ac’ (for autoconf 2.71
).
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.
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.
fixed problem detected by clang-UBSAN testing in ‘src/Ops.c’ (from arithmetic bug fix in 0.8-3).
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
.
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 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.
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.
matmult(x,y)
is identical to x %*% y
, but
matmult()
has further optional arguments fPrec
and
precBits
, see above.
New is.mpfr(x)
function; simple, with fast pre-test.
In pbetaI(q, ..)
, when q
is 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 invisibly TRUE
if
the change succeeded.
New log1mexp()
and log1pexp()
, as "from"
copula, notably as the vignette has been here, and authored
by me.
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” when
n
is of length zero and when an experimental version of
stopifnot(*, 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.
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.
Formatting incl print()
ing by default uses a "+"
after the exponential character ("e"
by default).
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 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.
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”.
formatMpfr()
and hence all print()
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 in x
; consequently
format()
and print()
may use less digits in case the
precision decreases along x
.
adapt to new C compiler default behavior -fno-common
,
using extern #include <Syms.h>
in most ‘*.c’ files.
Decreased the default for max.digits
to 999.
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.
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()
.
pnorm(<large>, log.p=TRUE)
no longer underflows much too
early, thanks to reports by Jerry Lewis.
print.mpfrArray()
now also uses a finite
max.digits
default, preventing, e.g., cbind(x, y)
to
use too many digits.
str(<mpfr>)
no longer calls formatMpfr(x, digits, *)
with a digits
vector of the same length as x
(which never worked correctly).
seqMpfr(1, length.out=8)
now works correctly.
unirootR()
gets an option to not warn on
non-convergence.
Provide a summary()
method for "mpfr"
numbers
closely modeled after summary.default
for numeric.
mpfr(NULL)
now works, returning mpfr(logical())
.
a simple sapplyMpfr()
function, showing how to work
around the fact that sapply()
does typically not work with
"mpfr"
numbers.
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
calling tcrossprod()
.
.mpfr2list()
and mpfrXport()
gain an option
names
(for nicer output).
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.
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.
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 array
s of these.
The "mpfr"
method of str()
gains option
internal
.
when print()
ing mpfr numbers, the result no longer sometimes
loses the last digit.
dnorm()
now works correctly with mpfr numbers;
similarly dbinom()
and dpois()
should work in all
cases, now.
in ‘NAMESPACE’, also exportMethods(apply)
, so
SNscan works.
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"
).
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.
head()
and tail()
methods for "mpfrMatrix"
.
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.
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 (see mpfrVersion
), which is hence (implicitly)
required for base
greater than 36.
formatMpfr()
gets a new argument base = 10
and can
be used to produce in other bases, notably binary (base = 2
)
or hexadecimal (base = 16
).
str(<mpfr>, ....)
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
.
matrix(mp, ..)
now also works when mp
is of
class "mpfr"
.
new matrix norm()
for several kind
s.
new functions formatHex()
and formatBin()
thanks to Rich Heiberger.
mpfr(x)
also works as inverse of
formatBin
and formatHex
.
roundMpfr()
and mathematical functions such as
jn
, or chooseMpfr()
get new optional argument
rnd.mode
passed to the corresponding MPFR function.
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.
pnorm(.)
, j0()
and similar special functions
now preserve mpfrMatrix
and mpfrArray
classes.
similarly, is.finite()
etc keep the
dim()
ensionality for "mpfrArray"
arguments.
mpfr("0xabc", base=16)
and mpfr("0b101",
base=2)
and corresponding getPrec()
now give the correct
precBits instead of too many.
str(<0-length mpfr>)
now works correctly.
.
as.integer()
now rounds “to zero” as for
regular R numbers (it accidentally did round “to nearest”
previously).
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.
.
The result of integrateR()
now prints even if a
warning happened.
pbetaI(x, a,b)
, the arbitrarily accurate
pbeta()
computation for integer a
and b
,
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.
.
.
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 C mpfr2i
).
See file ‘ChangeLog’