NEWS | R Documentation |
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.
.
.