Commit a9faf567 authored by Antoine Lucas's avatar Antoine Lucas
Browse files

version 0.6-4

parent b9840fc4
Package: gmp
Version: 0.6-3
Date: 2021-08-12
Version: 0.6-4
Date: 2022-02-23
Title: Multiple Precision Arithmetic
Author: Antoine Lucas, Immanuel Scholz, Rainer Boehme <rb-gmp@reflex-studio.de>,
Sylvain Jasson <Sylvain.Jasson@inrae.fr>,
......
* Remove full path in `configure.ac` script, with example of Rmpfr configure. -*-org-*-
* Bug Fixes
** TODO Logical ops should work: 0=FALSE NA=NA, <any_else>=TRUE
*** !as.bigz(0:3) crashes R badly (!!), but should return !(0:3) (logical vector).
terminate called after throwing an instance of 'std::length_error'
what(): vector::_M_default_append \\ ...R: line 141: 25400 Aborted (core dumped)
*** as.bigz(0:3) | as.bigz(0) etc should return logical as with regular numbers in R
** DONE Logical ops should work: 0=FALSE NA=NA, <any_else>=TRUE
*** DONE !as.bigz(0:3) crashes R badly (!!), but should return !(0:3) (logical vector).
*** DONE as.bigz(0:3) | as.bigz(0) etc should return logical as with regular numbers in R
** TODO `format()` currently works via as.character(.), particularly unsatisfying for bigz.
** TODO Not working column assignment : A[,j] <- vec does nothing, not warn, nothing -- but A[i,] <- val works ??
** TODO m <- matrix(1:6, 2); Z <- as.bigz(m); str(Z) fails because e.g. Z[5] fails, contrary m[5]
** DONE Not working column assignment : A[,j] <- vec does nothing, not warn, nothing -- but A[i,] <- val works ??
** DONE m <- matrix(1:6, 2); Z <- as.bigz(m); str(Z) fails because e.g. Z[5] fails, contrary m[5]
** TODO asNumeric(x) : the generic must get a "..." argument, so can use "rounding mode" in Rmpfr
** DONE URGENT / BAD : Segfaults, Wrong Results, etc
** TODO completely *wrong* pmin() and pmax(<bigq>, <number>): uses Numerator in comparison ???
** DONE completely *wrong* pmin() and pmax(<bigq>, <number>): uses Numerator in comparison ???
*** TODO: Find the *underlying* reason where pmin() goes wrong w/o warning!
** TODO Missing bigq %% and %/% [was 'Not working Arithmetic']
*** TODO bigq %% and %/% are not even defined (but are for 'numeric')!
......@@ -75,8 +73,8 @@ This is completely analogous to
One possibility: Using +- <LARGE>/1 for "bigq", as +- <LARGE> for "bigz"
** Matrix things
*** TODO want *different* M[1,] and M[1] for big[zq] matrices
*** TODO 3*M and M*3 are not the same: the first forgets the "nrow"
*** DONE want *different* M[1,] and M[1] for big[zq] matrices
*** DONE 3*M and M*3 are not the same: the first forgets the "nrow"
*** DONE x <- as.bigz(2:5); x[1] <- -1; x # -- a matrix !! >> no longer
*** DONE qq <- as.bigz(2:5)/7; qq[1] <- -1; qq # -- a matrix !!
*** abs(.) or sign(<big..matrix>) {and probably many others!}
......
......@@ -87,10 +87,11 @@ sapply(unaryfunctionid, numericFunName)
ex <- expression(23,as.bigz(23),as.bigq(23),c(3,23),as.bigz(c(3,23)),as.bigq(c(3,23)), "25", 2.3, -4, 4L, 0, as.bigz(34),
as.bigq(32,7), as.bigz(31,45), NULL,NA, -3L)## TODO: as.bigz(3)^700
x <- lapply(ex, eval)
## Those "numbers" in x for which arithmetic should also work in double precision:
## not modulo-arithmetic, not larger than double.prec
useN <- sapply(x, function(.) is.null(.) || is.na(.) ||
(is.finite(as.numeric(.)) && (!inherits(., "bigz") || is.null(modulus(.)))))
useN <- sapply(x, function(u) is.null(u[1]) || is.na(u[1]) ||
(is.finite(as.numeric(u[1])) && (!inherits(u[1], "bigz") || is.null(modulus(u[1])))))
## names(x) <- sapply(ex, format)
## shorter & easier:
names(x) <- sapply(x, formatN)
......
......@@ -119,10 +119,11 @@ The following objects are masked from 'package:base':
> ex <- expression(23,as.bigz(23),as.bigq(23),c(3,23),as.bigz(c(3,23)),as.bigq(c(3,23)), "25", 2.3, -4, 4L, 0, as.bigz(34),
+ as.bigq(32,7), as.bigz(31,45), NULL,NA, -3L)## TODO: as.bigz(3)^700
> x <- lapply(ex, eval)
>
> ## Those "numbers" in x for which arithmetic should also work in double precision:
> ## not modulo-arithmetic, not larger than double.prec
> useN <- sapply(x, function(.) is.null(.) || is.na(.) ||
+ (is.finite(as.numeric(.)) && (!inherits(., "bigz") || is.null(modulus(.)))))
> useN <- sapply(x, function(u) is.null(u[1]) || is.na(u[1]) ||
+ (is.finite(as.numeric(u[1])) && (!inherits(u[1], "bigz") || is.null(modulus(u[1])))))
> ## names(x) <- sapply(ex, format)
> ## shorter & easier:
> names(x) <- sapply(x, formatN)
......@@ -1348,4 +1349,4 @@ Big Integer ('bigz') object of length 2:
>
> proc.time()
user system elapsed
0.758 0.069 0.826
0.756 0.069 0.819
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment