Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
Sylvain Jasson
gmp
Commits
72830e26
Commit
72830e26
authored
Feb 22, 2022
by
Antoine Lucas
Browse files
update tests
parent
f1ac9e60
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/gmp-test.R
View file @
72830e26
...
...
@@ -47,14 +47,13 @@ test <- function(FUN, x, xlabs, out = "str", unary = FALSE)
}
## end{test}
allfunctionid
<-
c
(
"as.bigz"
,
"
add.bigz"
,
"sub.bigz"
,
"mul.bigz
"
,
"divq.bigz"
,
"
div.bigz"
,
"mod.bigz"
,
"pow.bigz
"
,
allfunctionid
<-
c
(
"as.bigz"
,
"
+"
,
"-"
,
"*
"
,
"divq.bigz"
,
"
/"
,
"%%"
,
"^
"
,
"inv.bigz"
,
"gcd.bigz"
,
"gcdex"
,
"lcm.bigz"
,
"as.bigq"
,
"add.bigq"
,
"sub.bigq"
,
"div.bigq"
,
"mul.bigq"
,
"pow.bigq"
,
"chooseZ"
,
"max
.bigq"
,
"max.bigz"
,
"min.bigq"
,
"min.bigz
"
,
"|"
,
"&"
,
"xor"
)
unaryfunctionid
<-
c
(
"log
.bigz
"
,
"log2
.bigz
"
,
"log10
.bigz"
,
"c.bigz
"
,
"max
"
,
"min
"
,
"|"
,
"&"
,
"xor"
)
unaryfunctionid
<-
c
(
"log"
,
"log2"
,
"log10
"
,
"c
"
,
"isprime"
,
"nextprime"
,
"factorialZ"
,
"sizeinbase"
,
"fibnum"
,
"fibnum2"
,
"lucnum"
,
"lucnum2"
,
"factorize"
,
"abs"
,
"!"
)
...
...
@@ -85,7 +84,7 @@ sapply(allfunctionid, numericFunName)
sapply
(
unaryfunctionid
,
numericFunName
)
ex
<-
expression
(
23
,
"25"
,
2.3
,
-4
,
4L
,
0
,
as.bigz
(
34
),
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:
...
...
tests/gmp-test.Rout.save
View file @
72830e26
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment