gmp-test.Rout.save 97.2 KB
Newer Older
Antoine Lucas's avatar
import  
Antoine Lucas committed
1

Antoine Lucas's avatar
Antoine Lucas committed
2
3
R Under development (unstable) (2022-02-20 r81781) -- "Unsuffered Consequences"
Copyright (C) 2022 The R Foundation for Statistical Computing
Antoine Lucas's avatar
import  
Antoine Lucas committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(gmp)

Attaching package: 'gmp'

The following objects are masked from 'package:base':

    %*%, apply, crossprod, matrix, tcrossprod

> 
> ##
> ##' @title Test a unary (if unary=TRUE) or *binary* function
> ##' @param FUN a function, such as add.bigq() ...
> ##' @param x a list of "numbers"
> ##' @param out string determining output class; if "str", use characters, otherwise double
> ##' @return
> ##' @author Antoine Lucas (& Martin Maechler)
> ##' @examples test(as.bigq, 0)
> test <- function(FUN, x, xlabs, out = "str", unary = FALSE)
+ {
+   if(missing(xlabs))
+     xlabs <- if(is.character(names(x))) names(x) else sapply(x, formatN)
+   stopifnot(is.function(FUN), is.list(x),
+ 	    (n <- length(x)) >= 1, length(xlabs) == n)
+   if(out == "str") {
+       sortie <- as.character
+       res <- ""
+       error <- "error"
+   } else {
+       sortie <- as.double
+       res <- 0
+       error <- NA
+   }
+   nr <- if(unary) 1 else n
+ ## FIXME  res <- matrix(res, nr, n, dimnames = list(if(!unary) xlabs, xlabs))
+ ## for now
+   res <- matrix(res, nr, n, dimnames = list(NULL, xlabs))
+ 
+   for(i in 1:nr)
+     for(j in 1:n) {
+       e <- if(unary) try(FUN(x[[j]]),        silent = TRUE) else
+                      try(FUN(x[[i]],x[[j]]), silent = TRUE)
+       if(inherits(e, "try-error"))
+         e <- error
+       else if(length(e) == 0)
+         e <- numeric()
+ 
+       ## ## now, for some functions also compute the corresponding numeric values
+       ## d <- if(unary) try(FUN(as.numeric(x[[j]])),                    silent = TRUE) else
+       ##                try(FUN(as.numeric(x[[i]]),as.numeric(x[[j]])), silent = TRUE)
+ 
+       res[i,j] <- sortie(e)[1]
+     }
+   res ## for printing, the user may prefer as.data.frame(.)
+ }## end{test}
> 
> 
Antoine Lucas's avatar
Antoine Lucas committed
74
75
> allfunctionid <- c("as.bigz","+","-","*",
+ 		   "divq.bigz","/","%%","^",
Antoine Lucas's avatar
import  
Antoine Lucas committed
76
77
78
+ 		   "inv.bigz", "gcd.bigz", "gcdex", "lcm.bigz",
+ 		   "as.bigq",
+ 		   "chooseZ",
Antoine Lucas's avatar
Antoine Lucas committed
79
80
+ 		   "max","min","|","&","xor")
> unaryfunctionid <- c("log","log2","log10","c",
Antoine Lucas's avatar
import  
Antoine Lucas committed
81
82
+ 		     "isprime","nextprime", "factorialZ",
+ 		     "sizeinbase","fibnum","fibnum2","lucnum","lucnum2",
Antoine Lucas's avatar
Antoine Lucas committed
83
+ 		     "factorize","abs","!")
Antoine Lucas's avatar
import  
Antoine Lucas committed
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
> numericFunName <- function(gmpName) {
+   if(gmpName != (r <- sub("[ZQ]$","", gmpName)) &&
+      r!="as" && existsFunction(r)) # e.g. chooseZ
+     return(r)
+   if(gmpName != (r <- sub("\\.big[zq]$","", gmpName)) &&
+      r!="as" && r!="sub" && existsFunction(r))
+     return(r)
+   ttt <- c("add" = "+",
+            "sub" = "-",
+            "mul" = "*",
+            "pow" = "^",
+            "div" = "/",
+            "divq" = "%/%",
+            "mod" = "%%")
+   if(!is.na(t.r <- ttt[r]))
+     t.r[[1L]]
+   else ## return argument
+     gmpName
+ }
> 
> 
> options(width = 125)
> 
> sapply(allfunctionid,   numericFunName)
Antoine Lucas's avatar
Antoine Lucas committed
108
   as.bigz          +          -          *  divq.bigz          /         %%          ^   inv.bigz   gcd.bigz      gcdex 
Antoine Lucas's avatar
import  
Antoine Lucas committed
109
 "as.bigz"        "+"        "-"        "*"      "%/%"        "/"       "%%"        "^" "inv.bigz"      "gcd"    "gcdex" 
Antoine Lucas's avatar
Antoine Lucas committed
110
111
  lcm.bigz    as.bigq    chooseZ        max        min          |          &        xor 
     "lcm"  "as.bigq"   "choose"      "max"      "min"        "|"        "&"      "xor" 
Antoine Lucas's avatar
import  
Antoine Lucas committed
112
> sapply(unaryfunctionid, numericFunName)
Antoine Lucas's avatar
Antoine Lucas committed
113
         log         log2        log10            c      isprime    nextprime   factorialZ   sizeinbase       fibnum 
Antoine Lucas's avatar
import  
Antoine Lucas committed
114
       "log"       "log2"      "log10"          "c"    "isprime"  "nextprime"  "factorial" "sizeinbase"     "fibnum" 
Antoine Lucas's avatar
Antoine Lucas committed
115
116
     fibnum2       lucnum      lucnum2    factorize          abs            ! 
   "fibnum2"     "lucnum"    "lucnum2"  "factorize"        "abs"          "!" 
Antoine Lucas's avatar
import  
Antoine Lucas committed
117
118
> 
> 
Antoine Lucas's avatar
Antoine Lucas committed
119
> 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),
Antoine Lucas's avatar
import  
Antoine Lucas committed
120
121
122
123
124
125
126
127
128
129
+                  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(.)))))
> ## names(x) <- sapply(ex, format)
> ## shorter & easier:
> names(x) <- sapply(x, formatN)
> str(x)
Antoine Lucas's avatar
Antoine Lucas committed
130
131
132
133
List of 17
 $ 23.             : num 23
 $ 23_Z            : 'bigz' raw 23
 $ 23/1            : 'bigq' raw 23
134
  ..- attr(*, "denominator")= raw [1:16] 01 00 00 00 ...
Antoine Lucas's avatar
Antoine Lucas committed
135
136
137
138
139
140
141
142
143
144
145
146
147
 $ c("3.", "23.")  : num [1:2] 3 23
 $ c("3_Z", "23_Z"): 'bigz' raw [1:2] 3 23
 $ c("3/1", "23/1"): 'bigq' raw [1:2] 3 23
  ..- attr(*, "denominator")= raw [1:28] 02 00 00 00 ...
 $ 25              : chr "25"
 $ 2.3             : num 2.3
 $ -4.             : num -4
 $ 4L              : int 4
 $ 0.              : num 0
 $ 34_Z            : 'bigz' raw 34
 $ 32/7            : 'bigq' raw 32/7
  ..- attr(*, "denominator")= raw [1:16] 01 00 00 00 ...
 $ (31 %% 45)      : 'bigz' raw (31 %% 45)
148
  ..- attr(*, "mod")= 'bigz' raw 45
Antoine Lucas's avatar
Antoine Lucas committed
149
150
151
 $ NULL            : NULL
 $ NA              : logi NA
 $ -3L             : int -3
Antoine Lucas's avatar
import  
Antoine Lucas committed
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
> x. <- x[useN]
> nx <- lapply(x., as.numeric)
> gmp.NS <- asNamespace("gmp")# also get namespace *hidden* functions, i.e. methods:
> for(fid in allfunctionid)
+   {
+     ##cat ("------------------------------------------\n", fid, "\n\n", sep="")
+     cat ("------------------------------------------\n", fid," ", sep="")
+     FUN <- get(fid, envir = gmp.NS, mode="function")
+     rc   <- test(FUN, x )
+     res  <- test(FUN, x. , out = "numeric")
+     if((nfid <- numericFunName(fid)) != fid || existsFunction(nfid, where=baseenv())) {
+       FUN <- get(nfid, envir = gmp.NS, mode="function")
+       if(nfid != fid) cat("-> num.fn.:", nfid)
+       cat("\n-> all.equal(target = res, current = F(<numeric x>)):\n")
+       nres <- test(FUN, nx, out = "numeric")
Antoine Lucas's avatar
Antoine Lucas committed
167
+      # print(all.equal(res, nres))
Antoine Lucas's avatar
import  
Antoine Lucas committed
168
169
170
171
172
173
174
+     } else cat("\n\n")
+     print(as.data.frame(rc)); cat("\n")
+     ##    ^^^^^^^^^^^^^ (for now, to diminuish difference to last version )
+   }
------------------------------------------
as.bigz 
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
          23.       23_Z       23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")         25      2.3       -4.       4L
1   (0 %% 23)  (0 %% 23)  (0 %% 23)       (2 %% 3)         (2 %% 3)         (2 %% 3) (23 %% 25) (1 %% 2) (3 %% -4) (3 %% 4)
2   (0 %% 23)  (0 %% 23)  (0 %% 23)       (2 %% 3)         (2 %% 3)         (2 %% 3) (23 %% 25) (1 %% 2) (3 %% -4) (3 %% 4)
3   (0 %% 23)  (0 %% 23)  (0 %% 23)       (2 %% 3)         (2 %% 3)         (2 %% 3) (23 %% 25) (1 %% 2) (3 %% -4) (3 %% 4)
4   (3 %% 23)  (3 %% 23)  (3 %% 23)       (0 %% 3)         (0 %% 3)         (0 %% 3)  (3 %% 25) (1 %% 2) (3 %% -4) (3 %% 4)
5   (3 %% 23)  (3 %% 23)  (3 %% 23)       (0 %% 3)         (0 %% 3)         (0 %% 3)  (3 %% 25) (1 %% 2) (3 %% -4) (3 %% 4)
6   (3 %% 23)  (3 %% 23)  (3 %% 23)       (0 %% 3)         (0 %% 3)         (0 %% 3)  (3 %% 25) (1 %% 2) (3 %% -4) (3 %% 4)
7   (2 %% 23)  (2 %% 23)  (2 %% 23)       (1 %% 3)         (1 %% 3)         (1 %% 3)  (0 %% 25) (1 %% 2) (1 %% -4) (1 %% 4)
8   (2 %% 23)  (2 %% 23)  (2 %% 23)       (2 %% 3)         (2 %% 3)         (2 %% 3)  (2 %% 25) (0 %% 2) (2 %% -4) (2 %% 4)
9  (19 %% 23) (19 %% 23) (19 %% 23)       (2 %% 3)         (2 %% 3)         (2 %% 3) (21 %% 25) (0 %% 2) (0 %% -4) (0 %% 4)
10  (4 %% 23)  (4 %% 23)  (4 %% 23)       (1 %% 3)         (1 %% 3)         (1 %% 3)  (4 %% 25) (0 %% 2) (0 %% -4) (0 %% 4)
11  (0 %% 23)  (0 %% 23)  (0 %% 23)       (0 %% 3)         (0 %% 3)         (0 %% 3)  (0 %% 25) (0 %% 2) (0 %% -4) (0 %% 4)
12 (11 %% 23) (11 %% 23) (11 %% 23)       (1 %% 3)         (1 %% 3)         (1 %% 3)  (9 %% 25) (0 %% 2) (2 %% -4) (2 %% 4)
13  (4 %% 23)  (4 %% 23)  (4 %% 23)       (1 %% 3)         (1 %% 3)         (1 %% 3)  (4 %% 25) (0 %% 2) (0 %% -4) (0 %% 4)
14  (8 %% 23)  (8 %% 23)  (8 %% 23)       (1 %% 3)         (1 %% 3)         (1 %% 3)  (6 %% 25) (1 %% 2) (3 %% -4) (3 %% 4)
15       <NA>       <NA>       <NA>           <NA>             <NA>             <NA>       <NA>     <NA>      <NA>     <NA>
16         NA         NA         NA             NA               NA               NA         NA       NA        NA       NA
17 (20 %% 23) (20 %% 23) (20 %% 23)       (0 %% 3)         (0 %% 3)         (0 %% 3) (22 %% 25) (1 %% 2) (1 %% -4) (1 %% 4)
      0.       34_Z       32/7 (31 %% 45) NULL   NA       -3L
1  error (23 %% 34) (23 %% 32) (23 %% 31)   23   23 (2 %% -3)
2  error (23 %% 34) (23 %% 32) (23 %% 31)   23   23 (2 %% -3)
3  error (23 %% 34) (23 %% 32) (23 %% 31)   23   23 (2 %% -3)
4  error  (3 %% 34)  (3 %% 32)  (3 %% 31)    3    3 (0 %% -3)
5  error  (3 %% 34)  (3 %% 32)  (3 %% 31)    3    3 (0 %% -3)
6  error  (3 %% 34)  (3 %% 32)  (3 %% 31)    3    3 (0 %% -3)
7  error (25 %% 34) (25 %% 32) (25 %% 31)   25   25 (1 %% -3)
8  error  (2 %% 34)  (2 %% 32)  (2 %% 31)    2    2 (2 %% -3)
9  error (30 %% 34) (28 %% 32) (27 %% 31)   -4   -4 (2 %% -3)
10 error  (4 %% 34)  (4 %% 32)  (4 %% 31)    4    4 (1 %% -3)
11 error  (0 %% 34)  (0 %% 32)  (0 %% 31)    0    0 (0 %% -3)
12 error  (0 %% 34)  (2 %% 32)  (3 %% 31)   34   34 (1 %% -3)
13 error  (4 %% 34)  (4 %% 32)  (4 %% 31)    4    4 (1 %% -3)
14 error (31 %% 34) (31 %% 32)  (0 %% 31)   31   31 (1 %% -3)
15  <NA>       <NA>       <NA>       <NA> <NA> <NA>      <NA>
16 error         NA         NA         NA   NA   NA        NA
17 error (31 %% 34) (29 %% 32) (28 %% 31)   -3   -3 (0 %% -3)
Antoine Lucas's avatar
import  
Antoine Lucas committed
211
212

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
213
+ 
Antoine Lucas's avatar
import  
Antoine Lucas committed
214
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
         23.      23_Z                               23/1 c("3.", "23.") c("3_Z", "23_Z")                  c("3/1", "23/1")
1         46        46                                 46             26               26                                26
2         46        46                                 46             26               26                                26
3         46        46                                 46             26               26                                26
4         26        26                                 26              6                6                                 6
5         26        26                                 26              6                6                                 6
6         26        26                                 26              6                6                                 6
7      error        48                                 48          error               28                                28
8       25.3        25 28485267643118387/1125899906842624            5.3                5 5967269506265907/1125899906842624
9         19        19                                 19             -1               -1                                -1
10        27        27                                 27              7                7                                 7
11        23        23                                 23              3                3                                 3
12        57        57                                 57             37               37                                37
13     193/7     193/7                              193/7           53/7             53/7                              53/7
14 (9 %% 45) (9 %% 45)                                 54     (34 %% 45)       (34 %% 45)                                34
15      <NA>      <NA>                               <NA>           <NA>             <NA>                              <NA>
16      <NA>        NA                                 NA           <NA>               NA                                NA
17        20        20                                 20              0                0                                 0
           25                                2.3        -4.         4L         0.       34_Z
1       error                               25.3         19         27         23         57
2          48                                 25         19         27         23         57
3          48 28485267643118387/1125899906842624         19         27         23         57
4       error                                5.3         -1          7          3         37
5          28                                  5         -1          7          3         37
6          28  5967269506265907/1125899906842624         -1          7          3         37
7       error                              error      error      error      error         59
8       error                                4.6       -1.7        6.3        2.3         36
9       error                               -1.7         -8          0         -4         30
10      error                                6.3          0          8          4         38
11      error                                2.3         -4          4          0         34
12         59                                 36         30         38         34         68
13      207/7 54155785519130213/7881299347898368        4/7       60/7       32/7      270/7
14 (11 %% 45)                         (33 %% 45) (27 %% 45) (35 %% 45) (31 %% 45) (20 %% 45)
15      error                               <NA>       <NA>       <NA>       <NA>       <NA>
16      error                               <NA>       <NA>       <NA>       <NA>         NA
17      error                               -0.7         -7          1         -3         31
                                 32/7 (31 %% 45)  NULL    NA        -3L
1                               193/7  (9 %% 45)  <NA>  <NA>         20
2                               193/7  (9 %% 45)  <NA>    NA         20
3                               193/7         54  <NA>    NA         20
4                                53/7 (34 %% 45)  <NA>  <NA>          0
5                                53/7 (34 %% 45)  <NA>    NA          0
6                                53/7         34  <NA>    NA          0
7                               207/7 (11 %% 45) error error      error
8  54155785519130213/7881299347898368 (33 %% 45)  <NA>  <NA>       -0.7
9                                 4/7 (27 %% 45)  <NA>  <NA>         -7
10                               60/7 (35 %% 45)  <NA>  <NA>          1
11                               32/7 (31 %% 45)  <NA>  <NA>         -3
12                              270/7 (20 %% 45)  <NA>    NA         31
13                               64/7      249/7  <NA>    NA       11/7
14                              249/7 (17 %% 45)  <NA>    NA (28 %% 45)
15                               <NA>       <NA>  <NA>  <NA>       <NA>
16                                 NA         NA  <NA>  <NA>       <NA>
17                               11/7 (28 %% 45)  <NA>  <NA>         -6
Antoine Lucas's avatar
import  
Antoine Lucas committed
269
270

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
271
- 
Antoine Lucas's avatar
import  
Antoine Lucas committed
272
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
         23.      23_Z                                23/1 c("3.", "23.") c("3_Z", "23_Z")                  c("3/1", "23/1")
1          0         0                                   0             20               20                                20
2          0         0                                   0             20               20                                20
3          0         0                                   0             20               20                                20
4        -20       -20                                 -20              0                0                                 0
5        -20       -20                                 -20              0                0                                 0
6        -20       -20                                 -20              0                0                                 0
7      error         2                                   2          error               22                                22
8      -20.7       -21 -23306128071642317/1125899906842624           -0.7               -1 -788129934789837/1125899906842624
9        -27       -27                                 -27             -7               -7                                -7
10       -19       -19                                 -19              1                1                                 1
11       -23       -23                                 -23             -3               -3                                -3
12        11        11                                  11             31               31                                31
13    -129/7    -129/7                              -129/7           11/7             11/7                              11/7
14 (8 %% 45) (8 %% 45)                                   8     (28 %% 45)       (28 %% 45)                                28
15      <NA>      <NA>                                <NA>           <NA>             <NA>                              <NA>
16      <NA>        NA                                  NA           <NA>               NA                                NA
17       -26       -26                                 -26             -6               -6                                -6
          25                                2.3        -4.         4L         0.       34_Z
1      error                               20.7         27         19         23        -11
2         -2                                 21         27         19         23        -11
3         -2 23306128071642317/1125899906842624         27         19         23        -11
4      error                                0.7          7         -1          3        -31
5        -22                                  1          7         -1          3        -31
6        -22   788129934789837/1125899906842624          7         -1          3        -31
7      error                              error      error      error      error         -9
8      error                                  0        6.3       -1.7        2.3        -32
9      error                               -6.3          0         -8         -4        -38
10     error                                1.7          8          0          4        -30
11     error                               -2.3          4         -4          0        -34
12         9                                 32         38         30         34          0
13    -143/7 17901808518797723/7881299347898368       60/7        4/7       32/7     -206/7
14 (6 %% 45)                         (29 %% 45) (35 %% 45) (27 %% 45) (31 %% 45) (42 %% 45)
15     error                               <NA>       <NA>       <NA>       <NA>       <NA>
16     error                               <NA>       <NA>       <NA>       <NA>         NA
17     error                               -5.3          1         -7         -3        -37
                                  32/7 (31 %% 45)       NULL    NA        -3L
1                                129/7 (37 %% 45)       <NA>  <NA>         26
2                                129/7 (37 %% 45)        -23    NA         26
3                                129/7         -8        -23    NA         26
4                                -11/7 (17 %% 45)       <NA>  <NA>          6
5                                -11/7 (17 %% 45)         -3    NA          6
6                                -11/7        -28         -3    NA          6
7                                143/7 (39 %% 45)      error error      error
8  -17901808518797723/7881299347898368 (16 %% 45)       <NA>  <NA>        5.3
9                                -60/7 (10 %% 45)       <NA>  <NA>         -1
10                                -4/7 (18 %% 45)       <NA>  <NA>          7
11                               -32/7 (14 %% 45)       <NA>  <NA>          3
12                               206/7  (3 %% 45)        -34    NA         37
13                                   0     -185/7      -32/7    NA       53/7
14                               185/7  (0 %% 45) (14 %% 45)    NA (34 %% 45)
15                                <NA>       <NA>       <NA>  <NA>       <NA>
16                                  NA         NA       <NA>  <NA>       <NA>
17                               -53/7 (11 %% 45)       <NA>  <NA>          0
Antoine Lucas's avatar
import  
Antoine Lucas committed
327
328

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
329
* 
Antoine Lucas's avatar
import  
Antoine Lucas committed
330
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
          23.       23_Z                               23/1 c("3.", "23.") c("3_Z", "23_Z")
1         529        529                                529             69               69
2         529        529                                529             69               69
3         529        529                                529             69               69
4          69         69                                 69              9                9
5          69         69                                 69              9                9
6          69         69                                 69              9                9
7       error        575                                575          error               75
8        52.9         46 59560105071974805/1125899906842624            6.9                6
9         -92        -92                                -92            -12              -12
10         92         92                                 92             12               12
11          0          0                                  0              0                0
12        782        782                                782            102              102
13      736/7      736/7                              736/7           96/7             96/7
14 (38 %% 45) (38 %% 45)                                713      (3 %% 45)        (3 %% 45)
15       <NA>       <NA>                               <NA>           <NA>             <NA>
16       <NA>         NA                                 NA           <NA>               NA
17        -69        -69                                -69             -9               -9
                    c("3/1", "23/1")         25                                2.3        -4.         4L        0.
1                                 69      error                               52.9        -92         92         0
2                                 69        575                                 46        -92         92         0
3                                 69        575 59560105071974805/1125899906842624        -92         92         0
4                                  9      error                                6.9        -12         12         0
5                                  9         75                                  6        -12         12         0
6                                  9         75  7768709357214105/1125899906842624        -12         12         0
7                                 75      error                              error      error      error     error
8  7768709357214105/1125899906842624      error                               5.29       -9.2        9.2         0
9                                -12      error                               -9.2         16        -16         0
10                                12      error                                9.2        -16         16         0
11                                 0      error                                  0          0          0         0
12                               102        850                                 68       -136        136         0
13                              96/7      800/7   2589569785738035/246290604621824     -128/7      128/7         0
14                                93 (10 %% 45)                         (17 %% 45) (11 %% 45) (34 %% 45) (0 %% 45)
15                              <NA>      error                               <NA>       <NA>       <NA>      <NA>
16                                NA      error                               <NA>       <NA>       <NA>      <NA>
17                                -9      error                               -6.9         12        -12         0
         34_Z                             32/7 (31 %% 45)  NULL    NA        -3L
1         782                            736/7 (38 %% 45)  <NA>  <NA>        -69
2         782                            736/7 (38 %% 45)  <NA>    NA        -69
3         782                            736/7        713  <NA>    NA        -69
4         102                             96/7  (3 %% 45)  <NA>  <NA>         -9
5         102                             96/7  (3 %% 45)  <NA>    NA         -9
6         102                             96/7         93  <NA>    NA         -9
7         850                            800/7 (10 %% 45) error error      error
8          68 2589569785738035/246290604621824 (17 %% 45)  <NA>  <NA>       -6.9
9        -136                           -128/7 (11 %% 45)  <NA>  <NA>         12
10        136                            128/7 (34 %% 45)  <NA>  <NA>        -12
11          0                                0  (0 %% 45)  <NA>  <NA>          0
12       1156                           1088/7 (19 %% 45)  <NA>    NA       -102
13     1088/7                          1024/49      992/7  <NA>    NA      -96/7
14 (19 %% 45)                            992/7 (16 %% 45)  <NA>    NA (42 %% 45)
15       <NA>                             <NA>       <NA>  <NA>  <NA>       <NA>
16         NA                               NA         NA  <NA>  <NA>       <NA>
17       -102                            -96/7 (42 %% 45)  <NA>  <NA>          9
Antoine Lucas's avatar
import  
Antoine Lucas committed
385
386
387
388

------------------------------------------
divq.bigz -> num.fn.: %/%
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
         23.      23_Z  23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")        25        2.3        -4.        4L   0.
1          1         1 error              7                7            error         0         11         -6         5   NA
2          1         1 error              7                7            error         0         11         -6         5   NA
3          1         1 error              7                7            error         0         11         -6         5   NA
4          0         0 error              1                1            error         0          1         -1         0   NA
5          0         0 error              1                1            error         0          1         -1         0   NA
6          0         0 error              1                1            error         0          1         -1         0   NA
7          1         1 error              8                8            error         1         12         -7         6   NA
8          0         0 error              0                0            error         0          1         -1         0   NA
9         -1        -1 error             -2               -2            error        -1         -2          1        -1   NA
10         0         0 error              1                1            error         0          2         -1         1   NA
11         0         0 error              0                0            error         0          0          0         0   NA
12         1         1 error             11               11            error         1         17         -9         8   NA
13         1         1 error             10               10            error         1         16         -8         8   NA
14 (1 %% 45) (1 %% 45) error     (10 %% 45)       (10 %% 45)            error (1 %% 45) (15 %% 45) (37 %% 45) (7 %% 45)   NA
15      <NA>      <NA> error           <NA>             <NA>            error      <NA>       <NA>       <NA>      <NA> <NA>
16        NA        NA error             NA               NA            error        NA         NA         NA        NA   NA
17        -1        -1 error             -1               -1            error        -1         -2          0        -1   NA
        34_Z      32/7 (31 %% 45) NULL   NA        -3L
1          0         5  (0 %% 45) <NA>   NA         -8
2          0         5  (0 %% 45) <NA>   NA         -8
3          0         5  (0 %% 45) <NA>   NA         -8
4          0         0  (0 %% 45) <NA>   NA         -1
5          0         0  (0 %% 45) <NA>   NA         -1
6          0         0  (0 %% 45) <NA>   NA         -1
7          0         6  (0 %% 45) <NA>   NA         -9
8          0         0  (0 %% 45) <NA>   NA         -1
9         -1        -1 (44 %% 45) <NA>   NA          1
10         0         1  (0 %% 45) <NA>   NA         -2
11         0         0  (0 %% 45) <NA>   NA          0
12         1         8  (1 %% 45) <NA>   NA        -12
13         0         8  (1 %% 45) <NA>   NA        -11
14 (0 %% 45) (7 %% 45)  (1 %% 45) <NA>   NA (34 %% 45)
15      <NA>      <NA>       <NA> <NA> <NA>       <NA>
16        NA        NA         NA <NA>   NA         NA
17        -1        -1 (44 %% 45) <NA>   NA          1
Antoine Lucas's avatar
import  
Antoine Lucas committed
425
426

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
427
/ 
Antoine Lucas's avatar
import  
Antoine Lucas committed
428
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
                  23.                               23_Z                               23/1    c("3.", "23.")
1                   1                                  1                                  1  7.66666666666667
2                   1                                  1                                  1              23/3
3                   1                                  1                                  1              23/3
4   0.130434782608696                               3/23                               3/23                 1
5                3/23                               3/23                               3/23                 1
6                3/23                               3/23                               3/23                 1
7               error                              25/23                              25/23             error
8                 0.1 2589569785738035/25895697857380352 2589569785738035/25895697857380352 0.766666666666667
9  -0.173913043478261                              -4/23                              -4/23 -1.33333333333333
10  0.173913043478261                               4/23                               4/23  1.33333333333333
11                  0                                  0                                  0                 0
12              34/23                              34/23                              34/23              34/3
13             32/161                             32/161                             32/161             32/21
14         (17 %% 45)                         (17 %% 45)                              31/23                NA
15               <NA>                               <NA>                               <NA>              <NA>
16               <NA>                                 NA                                 NA              <NA>
17 -0.130434782608696                              -3/23                              -3/23                -1
                   c("3_Z", "23_Z")                 c("3/1", "23/1")     25                                 2.3        -4.
1                              23/3                             23/3  error                                  10      -5.75
2                              23/3                             23/3  23/25  25895697857380352/2589569785738035      -23/4
3                              23/3                             23/3  23/25  25895697857380352/2589569785738035      -23/4
4                                 1                                1  error                    1.30434782608696      -0.75
5                                 1                                1   3/25    1125899906842624/863189928579345       -3/4
6                                 1                                1   3/25    1125899906842624/863189928579345       -3/4
7                              25/3                             25/3  error                               error      error
8  863189928579345/1125899906842624 863189928579345/1125899906842624  error                                   1     -0.575
9                              -4/3                             -4/3  error                   -1.73913043478261          1
10                              4/3                              4/3  error                    1.73913043478261         -1
11                                0                                0  error                                   0          0
12                             34/3                             34/3  34/25  38280596832649216/2589569785738035      -17/2
13                            32/21                            32/21 32/175 36028797018963968/18126988500166245       -8/7
14                               NA                             31/3     NA                          (38 %% 45) (26 %% 45)
15                             <NA>                             <NA>  error                                <NA>       <NA>
16                               NA                               NA  error                                <NA>       <NA>
17                               -1                               -1  error                   -1.30434782608696       0.75
           4L    0.                               34_Z                                32/7 (31 %% 45)  NULL    NA
1        5.75   Inf                              23/34                              161/32  (8 %% 45)  <NA>  <NA>
2        23/4 error                              23/34                              161/32  (8 %% 45)  <NA>    NA
3        23/4 error                              23/34                              161/32      23/31  <NA>    NA
4        0.75   Inf                               3/34                               21/32  (3 %% 45)  <NA>  <NA>
5         3/4 error                               3/34                               21/32  (3 %% 45)  <NA>    NA
6         3/4 error                               3/34                               21/32       3/31  <NA>    NA
7       error error                              25/34                              175/32 (40 %% 45) error error
8       0.575   Inf 2589569785738035/38280596832649216 18126988500166245/36028797018963968 (32 %% 45)  <NA>  <NA>
9          -1  -Inf                              -2/17                                -7/8 (26 %% 45)  <NA>  <NA>
10          1   Inf                               2/17                                 7/8 (19 %% 45)  <NA>  <NA>
11          0   NaN                                  0                                   0  (0 %% 45)  <NA>  <NA>
12       17/2 error                                  1                              119/16  (4 %% 45)  <NA>    NA
13        8/7 error                             16/119                                   1     32/217  <NA>    NA
14 (19 %% 45)    NA                         (34 %% 45)                              217/32  (1 %% 45)  <NA>    NA
15       <NA>  <NA>                               <NA>                                <NA>       <NA>  <NA>  <NA>
16       <NA>  <NA>                                 NA                                  NA         NA  <NA>  <NA>
17      -0.75  -Inf                              -3/34                              -21/32 (42 %% 45)  <NA>  <NA>
                  -3L
1   -7.66666666666667
2               -23/3
3               -23/3
4                  -1
5                  -1
6                  -1
7               error
8  -0.766666666666667
9    1.33333333333333
10  -1.33333333333333
11                  0
12              -34/3
13             -32/21
14                 NA
15               <NA>
16               <NA>
17                  1
Antoine Lucas's avatar
import  
Antoine Lucas committed
501
502

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
503
%% 
Antoine Lucas's avatar
import  
Antoine Lucas committed
504
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
         23.      23_Z  23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")        25                  2.3       -4.
1          0         0 error              2                2            error     error 1.77635683940025e-15        -1
2          0         0 error              2                2            error        23                    1         3
3      error         0 error          error                2            error     error                error     error
4          3         3 error              0                0            error     error                  0.7        -1
5          3         3 error              0                0            error         3                    1         3
6      error         3 error          error                0            error     error                error     error
7      error         2 error          error                1            error     error                error     error
8        2.3         2 error            2.3                2            error     error                    0      -1.7
9         19        19 error              2                2            error     error                  0.6         0
10         4         4 error              1                1            error     error                  1.7         0
11         0         0 error              0                0            error     error                    0         0
12        11        11 error              1                1            error         9                    0         2
13     error         9 error          error                2            error     error                error     error
14 (8 %% 23) (8 %% 23) error       (1 %% 3)         (1 %% 3)            error (6 %% 25)             (1 %% 2) (3 %% -4)
15      <NA>      <NA> error           <NA>             <NA>            error     error                 <NA>      <NA>
16      <NA>        NA error           <NA>               NA            error     error                 <NA>      <NA>
17        20        20 error              0                0            error     error                  1.6        -3
         4L    0.       34_Z     32/7 (31 %% 45)  NULL    NA       -3L
1         3   NaN         23    error (23 %% 31)  <NA>  <NA>        -1
2         3    NA         23        3 (23 %% 31)  <NA>    NA         2
3     error error         23    error (23 %% 31) error error     error
4         3   NaN          3    error  (3 %% 31)  <NA>  <NA>         0
5         3    NA          3        3  (3 %% 31)  <NA>    NA         0
6     error error          3    error  (3 %% 31) error error     error
7     error error         25    error (25 %% 31) error error     error
8       2.3   NaN          2    error  (2 %% 31)  <NA>  <NA>      -0.7
9         0   NaN         30    error (27 %% 31)  <NA>  <NA>        -1
10        0   NaN          4    error  (4 %% 31)  <NA>  <NA>        -2
11        0   NaN          0    error  (0 %% 31)  <NA>  <NA>         0
12        2    NA          0        2  (3 %% 31)  <NA>    NA         1
13    error error         32    error  (1 %% 31) error error     error
14 (3 %% 4)    NA (31 %% 34) (3 %% 4)  (0 %% 31)  <NA>    NA (1 %% -3)
15     <NA>  <NA>       <NA>    error       <NA>  <NA>  <NA>      <NA>
16     <NA>   NaN         NA    error         NA  <NA>  <NA>      <NA>
17        1   NaN         31    error (28 %% 31)  <NA>  <NA>         0
Antoine Lucas's avatar
import  
Antoine Lucas committed
541
542

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
543
^ 
Antoine Lucas's avatar
import  
Antoine Lucas committed
544
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
                                                        23.                                                     23_Z
1                                      2.08804679998479e+31                         20880467999847912034355032910567
2                          20880467999847912034355032910567                         20880467999847912034355032910567
3                          20880467999847912034355032910567                         20880467999847912034355032910567
4                                               94143178827                                              94143178827
5                                               94143178827                                              94143178827
6                                               94143178827                                              94143178827
7                                                     error                        142108547152020037174224853515625
8                                          208804679.998479                                                  8388608
9                                           -70368744177664                                          -70368744177664
10                                           70368744177664                                           70368744177664
11                                                        0                                                        0
12                     167500108222301408246337399112597504                     167500108222301408246337399112597504
13 41538374868278621028243970633760768/27368747340080916343 41538374868278621028243970633760768/27368747340080916343
14                                               (16 %% 45)                                               (16 %% 45)
15                                                     <NA>                                                     <NA>
16                                                     <NA>                                                       NA
17                                             -94143178827                                             -94143178827
                                                       23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")
1                          20880467999847912034355032910567          12167            12167            12167
2                          20880467999847912034355032910567          12167            12167            12167
3                          20880467999847912034355032910567          12167            12167            12167
4                                               94143178827             27               27               27
5                                               94143178827             27               27               27
6                                               94143178827             27               27               27
7                         142108547152020037174224853515625          error            15625            15625
8                                                   8388608         12.167                8                8
9                                           -70368744177664            -64              -64              -64
10                                           70368744177664             64               64               64
11                                                        0              0                0                0
12                     167500108222301408246337399112597504          39304            39304            39304
13 41538374868278621028243970633760768/27368747340080916343      32768/343        32768/343        32768/343
14                                               (16 %% 45)      (1 %% 45)        (1 %% 45)        (1 %% 45)
15                                                     <NA>           <NA>             <NA>             <NA>
16                                                       NA           <NA>               NA               NA
17                                             -94143178827            -27              -27              -27
                                                              25              2.3                  -4.           4L
1                                                          error 1355.10835463513 3.57345778495646e-06       279841
2                            11045767571919545466173812409689943            error             1/279841       279841
3                            11045767571919545466173812409689943            error             1/279841       279841
4                                                          error 12.5135025328432   0.0123456790123457           81
5                                                   847288609443            error                 1/81           81
6                                                   847288609443            error                 1/81           81
7                                                          error            error                error        error
8                                                          error 6.79163007524788   0.0357345778495646      27.9841
9                                                          error              NaN           0.00390625          256
10                                                         error 24.2514650641664           0.00390625          256
11                                                         error                0                  Inf            0
12                       193630125104980427932766033374162714624            error            1/1336336      1336336
13 42535295865117307932921825928971026432/1341068619663964900807            error         2401/1048576 1048576/2401
14                                                    (31 %% 45)            error           (16 %% 45)   (31 %% 45)
15                                                         error             <NA>                 <NA>         <NA>
16                                                         error             <NA>                 <NA>         <NA>
17                                                         error              NaN   0.0123456790123457           81
          0.                                                                               34_Z  32/7
1          1                                    19895113660064588580108197261066338165074766609 error
2          1                                    19895113660064588580108197261066338165074766609 error
3          1                                    19895113660064588580108197261066338165074766609 error
4          1                                                                  16677181699666569 error
5          1                                                                  16677181699666569 error
6          1                                                                  16677181699666569 error
7      error                                   338813178901720135627329000271856784820556640625 error
8          1                                                                        17179869184 error
9          1                                                              295147905179352825856 error
10         1                                                              295147905179352825856 error
11         1                                                                                  0 error
12         1                              11756638905368616011414050501310355554617941909569536 error
13         1 1496577676626844588240573268701473812127674924007424/54116956037952111668959660849 error
14 (1 %% 45)                                                                         (31 %% 45) error
15      <NA>                                                                               <NA> error
16         1                                                                                 NA error
17         1                                                                  16677181699666569 error
                                                                    (31 %% 45)  NULL    NA                  -3L
1                                                                   (32 %% 45)  <NA>  <NA> 8.21895290539985e-05
2                                                                   (32 %% 45)  <NA>    NA              1/12167
3                                  1635170022196481349560959748587682926364327  <NA>    NA              1/12167
4                                                                   (27 %% 45)  <NA>  <NA>    0.037037037037037
5                                                                   (27 %% 45)  <NA>    NA                 1/27
6                                                              617673396283947  <NA>    NA                 1/27
7                                                                   (25 %% 45) error error                error
8                                                                   (38 %% 45)  <NA>  <NA>   0.0821895290539985
9                                                                   (41 %% 45)  <NA>  <NA>            -0.015625
10                                                                   (4 %% 45)  <NA>  <NA>             0.015625
11                                                                   (0 %% 45)  <NA>  <NA>                  Inf
12                                                                  (34 %% 45)  <NA>    NA              1/39304
13 45671926166590716193865151022383844364247891968/157775382034845806615042743  <NA>    NA            343/32768
14                                                                  (31 %% 45)  <NA>    NA            (1 %% 45)
15                                                                        <NA>  <NA>  <NA>                 <NA>
16                                                                          NA  <NA>  <NA>                 <NA>
17                                                                  (18 %% 45)  <NA>  <NA>   -0.037037037037037
Antoine Lucas's avatar
import  
Antoine Lucas committed
635
636
637
638

------------------------------------------
inv.bigz 
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
         23.      23_Z      23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")         25       2.3       -4.        4L
1         NA        NA        NA              2                2                2         12         1         3         3
2         NA        NA        NA              2                2                2         12         1         3         3
3         NA        NA        NA              2                2                2         12         1         3         3
4          8         8         8             NA               NA               NA         17         1         3         3
5          8         8         8             NA               NA               NA         17         1         3         3
6          8         8         8             NA               NA               NA         17         1         3         3
7         12        12        12              1                1                1         NA         1         1         1
8         12        12        12              2                2                2         13        NA        NA        NA
9         17        17        17              2                2                2          6        NA        NA        NA
10         6         6         6              1                1                1         19        NA        NA        NA
11        NA        NA        NA             NA               NA               NA         NA        NA        NA        NA
12        21        21        21              1                1                1         14        NA        NA        NA
13        18        18        18              2                2                2         18        NA        NA        NA
14 (3 %% 45) (3 %% 45) (3 %% 45)      (1 %% 45)        (1 %% 45)        (1 %% 45) (21 %% 45) (1 %% 45) (3 %% 45) (3 %% 45)
15      <NA>      <NA>      <NA>           <NA>             <NA>             <NA>       <NA>      <NA>      <NA>      <NA>
16        NA        NA        NA             NA               NA               NA         NA        NA        NA        NA
17        15        15        15             NA               NA               NA          8         1         1         1
     0.       34_Z       32/7 (31 %% 45) NULL   NA       -3L
1    NA          3          7 (27 %% 45) <NA>   NA         2
2    NA          3          7 (27 %% 45) <NA>   NA         2
3    NA          3          7 (27 %% 45) <NA>   NA         2
4    NA         23         11 (21 %% 45) <NA>   NA        NA
5    NA         23         11 (21 %% 45) <NA>   NA        NA
6    NA         23         11 (21 %% 45) <NA>   NA        NA
7    NA         15          9  (5 %% 45) <NA>   NA         1
8    NA         NA         NA (16 %% 45) <NA>   NA         2
9    NA         NA         NA (23 %% 45) <NA>   NA         2
10   NA         NA         NA  (8 %% 45) <NA>   NA         1
11   NA         NA         NA         NA <NA>   NA        NA
12   NA         NA         NA (21 %% 45) <NA>   NA         1
13   NA         NA         NA  (1 %% 45) <NA>   NA         2
14   NA (11 %% 45) (31 %% 45)         NA <NA>   NA (1 %% 45)
15 <NA>       <NA>       <NA>       <NA> <NA> <NA>      <NA>
16   NA         NA         NA         NA <NA>   NA        NA
17   NA         11         21 (10 %% 45) <NA>   NA        NA
Antoine Lucas's avatar
import  
Antoine Lucas committed
675
676
677
678

------------------------------------------
gcd.bigz -> num.fn.: gcd
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
         23.      23_Z      23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")        25       2.3       -4.        4L
1         23        23        23              1                1                1         1         1         1         1
2         23        23        23              1                1                1         1         1         1         1
3         23        23        23              1                1                1         1         1         1         1
4          1         1         1              3                3                3         1         1         1         1
5          1         1         1              3                3                3         1         1         1         1
6          1         1         1              3                3                3         1         1         1         1
7          1         1         1              1                1                1        25         1         1         1
8          1         1         1              1                1                1         1         2         2         2
9          1         1         1              1                1                1         1         2         4         4
10         1         1         1              1                1                1         1         2         4         4
11        23        23        23              3                3                3        25         2         4         4
12         1         1         1              1                1                1         1         2         2         2
13         1         1         1              1                1                1         1         2         4         4
14 (1 %% 45) (1 %% 45) (1 %% 45)      (1 %% 45)        (1 %% 45)        (1 %% 45) (1 %% 45) (1 %% 45) (1 %% 45) (1 %% 45)
15      <NA>      <NA>      <NA>           <NA>             <NA>             <NA>      <NA>      <NA>      <NA>      <NA>
16        NA        NA        NA             NA               NA               NA        NA        NA        NA        NA
17         1         1         1              3                3                3         1         1         1         1
           0.      34_Z      32/7 (31 %% 45) NULL   NA       -3L
1          23         1         1  (1 %% 45) <NA>   NA         1
2          23         1         1  (1 %% 45) <NA>   NA         1
3          23         1         1  (1 %% 45) <NA>   NA         1
4           3         1         1  (1 %% 45) <NA>   NA         3
5           3         1         1  (1 %% 45) <NA>   NA         3
6           3         1         1  (1 %% 45) <NA>   NA         3
7          25         1         1  (1 %% 45) <NA>   NA         1
8           2         2         2  (1 %% 45) <NA>   NA         1
9           4         2         4  (1 %% 45) <NA>   NA         1
10          4         2         4  (1 %% 45) <NA>   NA         1
11          0        34        32 (31 %% 45) <NA>   NA         3
12         34        34         2  (1 %% 45) <NA>   NA         1
13         32         2        32  (1 %% 45) <NA>   NA         1
14 (31 %% 45) (1 %% 45) (1 %% 45) (31 %% 45) <NA>   NA (1 %% 45)
15       <NA>      <NA>      <NA>       <NA> <NA> <NA>      <NA>
16         NA        NA        NA         NA <NA>   NA        NA
17          3         1         1  (1 %% 45) <NA>   NA         3
Antoine Lucas's avatar
import  
Antoine Lucas committed
715
716
717
718

------------------------------------------
gcdex 
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
    23. 23_Z 23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")   25  2.3  -4.   4L   0. 34_Z 32/7 (31 %% 45) NULL   NA
1    23   23   23           <NA>             <NA>             <NA>    1    1    1    1   23    1    1          1 <NA>   23
2    23   23   23           <NA>             <NA>             <NA>    1    1    1    1   23    1    1          1 <NA>   23
3    23   23   23           <NA>             <NA>             <NA>    1    1    1    1   23    1    1          1 <NA>   23
4  <NA> <NA> <NA>              3                3                3 <NA> <NA> <NA> <NA> <NA> <NA> <NA>       <NA> <NA> <NA>
5  <NA> <NA> <NA>              3                3                3 <NA> <NA> <NA> <NA> <NA> <NA> <NA>       <NA> <NA> <NA>
6  <NA> <NA> <NA>              3                3                3 <NA> <NA> <NA> <NA> <NA> <NA> <NA>       <NA> <NA> <NA>
7     1    1    1           <NA>             <NA>             <NA>   25    1    1    1   25    1    1          1 <NA>   25
8     1    1    1           <NA>             <NA>             <NA>    1    2    2    2    2    2    2          1 <NA>    2
9     1    1    1           <NA>             <NA>             <NA>    1    2    4    4    4    2    4          1 <NA>    4
10    1    1    1           <NA>             <NA>             <NA>    1    2    4    4    4    2    4          1 <NA>    4
11   23   23   23           <NA>             <NA>             <NA>   25    2    4    4    0   34   32         31 <NA>    0
12    1    1    1           <NA>             <NA>             <NA>    1    2    2    2   34   34    2          1 <NA>   34
13    1    1    1           <NA>             <NA>             <NA>    1    2    4    4   32    2   32          1 <NA>   32
14    1    1    1           <NA>             <NA>             <NA>    1    1    1    1   31    1    1         31 <NA>   31
15 <NA> <NA> <NA>           <NA>             <NA>             <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>       <NA> <NA> <NA>
16   23   23   23           <NA>             <NA>             <NA>   25    2    4    4    0   34   32         31 <NA>    0
17    1    1    1           <NA>             <NA>             <NA>    1    1    1    1    3    1    1          1 <NA>    3
    -3L
Antoine Lucas's avatar
import  
Antoine Lucas committed
738
739
740
1     1
2     1
3     1
Antoine Lucas's avatar
Antoine Lucas committed
741
742
743
4  <NA>
5  <NA>
6  <NA>
Antoine Lucas's avatar
import  
Antoine Lucas committed
744
745
746
7     1
8     1
9     1
Antoine Lucas's avatar
Antoine Lucas committed
747
748
10    1
11    3
Antoine Lucas's avatar
import  
Antoine Lucas committed
749
12    1
Antoine Lucas's avatar
Antoine Lucas committed
750
751
752
753
754
13    1
14    1
15 <NA>
16    3
17    3
Antoine Lucas's avatar
import  
Antoine Lucas committed
755
756

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
757
lcm.bigz -> num.fn.: lcm
Antoine Lucas's avatar
import  
Antoine Lucas committed
758
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
          23.       23_Z       23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")         25        2.3        -4.
1          23         23         23             69               69               69        575         46         92
2          23         23         23             69               69               69        575         46         92
3          23         23         23             69               69               69        575         46         92
4          69         69         69              3                3                3         75          6         12
5          69         69         69              3                3                3         75          6         12
6          69         69         69              3                3                3         75          6         12
7         575        575        575             75               75               75         25         50        100
8          46         46         46              6                6                6         50          2          4
9          92         92         92             12               12               12        100          4          4
10         92         92         92             12               12               12        100          4          4
11          0          0          0              0                0                0          0          0          0
12        782        782        782            102              102              102        850         34         68
13        736        736        736             96               96               96        800         32         32
14 (38 %% 45) (38 %% 45) (38 %% 45)      (3 %% 45)        (3 %% 45)        (3 %% 45) (10 %% 45) (17 %% 45) (34 %% 45)
15       <NA>       <NA>       <NA>           <NA>             <NA>             <NA>       <NA>       <NA>       <NA>
16         NA         NA         NA             NA               NA               NA         NA         NA         NA
17         69         69         69              3                3                3         75          6         12
           4L        0.       34_Z      32/7 (31 %% 45) NULL   NA       -3L
1          92         0        782       736 (38 %% 45) <NA>   NA        69
2          92         0        782       736 (38 %% 45) <NA>   NA        69
3          92         0        782       736 (38 %% 45) <NA>   NA        69
4          12         0        102        96  (3 %% 45) <NA>   NA         3
5          12         0        102        96  (3 %% 45) <NA>   NA         3
6          12         0        102        96  (3 %% 45) <NA>   NA         3
7         100         0        850       800 (10 %% 45) <NA>   NA        75
8           4         0         34        32 (17 %% 45) <NA>   NA         6
9           4         0         68        32 (34 %% 45) <NA>   NA        12
10          4         0         68        32 (34 %% 45) <NA>   NA        12
11          0         0          0         0  (0 %% 45) <NA>   NA         0
12         68         0         34       544 (19 %% 45) <NA>   NA       102
13         32         0        544        32  (2 %% 45) <NA>   NA        96
14 (34 %% 45) (0 %% 45) (19 %% 45) (2 %% 45) (31 %% 45) <NA>   NA (3 %% 45)
15       <NA>      <NA>       <NA>      <NA>       <NA> <NA> <NA>      <NA>
16         NA        NA         NA        NA         NA <NA>   NA        NA
17         12         0        102        96  (3 %% 45) <NA>   NA         3
Antoine Lucas's avatar
import  
Antoine Lucas committed
795
796

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
797
as.bigq 
Antoine Lucas's avatar
import  
Antoine Lucas committed
798
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
                                  23.                               23_Z                               23/1
1                                   1                                  1                                  1
2                                   1                                  1                                  1
3                                   1                                  1                                  1
4                                3/23                               3/23                               3/23
5                                3/23                               3/23                               3/23
6                                3/23                               3/23                               3/23
7                               25/23                              25/23                              25/23
8  2589569785738035/25895697857380352 2589569785738035/25895697857380352 2589569785738035/25895697857380352
9                               -4/23                              -4/23                              -4/23
10                               4/23                               4/23                               4/23
11                                  0                                  0                                  0
12                              34/23                              34/23                              34/23
13                             32/161                             32/161                             32/161
14                              31/23                              31/23                              31/23
15                               <NA>                               <NA>                               <NA>
16                                 NA                                 NA                                 NA
17                              -3/23                              -3/23                              -3/23
                     c("3.", "23.")                 c("3_Z", "23_Z")                 c("3/1", "23/1")
1                              23/3                             23/3                             23/3
2                              23/3                             23/3                             23/3
3                              23/3                             23/3                             23/3
4                                 1                                1                                1
5                                 1                                1                                1
6                                 1                                1                                1
7                              25/3                             25/3                             25/3
8  863189928579345/1125899906842624 863189928579345/1125899906842624 863189928579345/1125899906842624
9                              -4/3                             -4/3                             -4/3
10                              4/3                              4/3                              4/3
11                                0                                0                                0
12                             34/3                             34/3                             34/3
13                            32/21                            32/21                            32/21
14                             31/3                             31/3                             31/3
15                             <NA>                             <NA>                             <NA>
16                               NA                               NA                               NA
17                               -1                               -1                               -1
                                 25                                 2.3                                -4.
1                             23/25  25895697857380352/2589569785738035                              -23/4
2                             23/25  25895697857380352/2589569785738035                              -23/4
3                             23/25  25895697857380352/2589569785738035                              -23/4
4                              3/25    1125899906842624/863189928579345                               -3/4
5                              3/25    1125899906842624/863189928579345                               -3/4
6                              3/25    1125899906842624/863189928579345                               -3/4
7                                 1    5629499534213120/517913957147607                              -25/4
8  517913957147607/5629499534213120                                   1 -2589569785738035/4503599627370496
9                             -4/25  -4503599627370496/2589569785738035                                  1
10                             4/25   4503599627370496/2589569785738035                                 -1
11                                0                                   0                                  0
12                            34/25  38280596832649216/2589569785738035                              -17/2
13                           32/175 36028797018963968/18126988500166245                               -8/7
14                            31/25  34902897112121344/2589569785738035                              -31/4
15                             <NA>                                <NA>                               <NA>
16                               NA                                  NA                                 NA
17                            -3/25   -1125899906842624/863189928579345                                3/4
                                  4L    0.                               34_Z                                32/7
1                               23/4 error                              23/34                              161/32
2                               23/4 error                              23/34                              161/32
3                               23/4 error                              23/34                              161/32
4                                3/4 error                               3/34                               21/32
5                                3/4 error                               3/34                               21/32
6                                3/4 error                               3/34                               21/32
7                               25/4 error                              25/34                              175/32
8  2589569785738035/4503599627370496 error 2589569785738035/38280596832649216 18126988500166245/36028797018963968
9                                 -1 error                              -2/17                                -7/8
10                                 1 error                               2/17                                 7/8
11                                 0 error                                  0                                   0
12                              17/2 error                                  1                              119/16
13                               8/7 error                             16/119                                   1
14                              31/4 error                              31/34                              217/32
15                              <NA>  <NA>                               <NA>                                <NA>
16                                NA    NA                                 NA                                  NA
17                              -3/4 error                              -3/34                              -21/32
                           (31 %% 45) NULL   NA                               -3L
1                               23/31 <NA>   NA                             -23/3
2                               23/31 <NA>   NA                             -23/3
3                               23/31 <NA>   NA                             -23/3
4                                3/31 <NA>   NA                                -1
5                                3/31 <NA>   NA                                -1
6                                3/31 <NA>   NA                                -1
7                               25/31 <NA>   NA                             -25/3
8  2589569785738035/34902897112121344 <NA>   NA -863189928579345/1125899906842624
9                               -4/31 <NA>   NA                               4/3
10                               4/31 <NA>   NA                              -4/3
11                                  0 <NA>   NA                                 0
12                              34/31 <NA>   NA                             -34/3
13                             32/217 <NA>   NA                            -32/21
14                                  1 <NA>   NA                             -31/3
15                               <NA> <NA> <NA>                              <NA>
16                                 NA <NA>   NA                                NA
17                              -3/31 <NA>   NA                                 1
Antoine Lucas's avatar
import  
Antoine Lucas committed
889
890

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
891
chooseZ -> num.fn.: choose
Antoine Lucas's avatar
import  
Antoine Lucas committed
892
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
         23.      23_Z      23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")       25  2.3  -4.    4L   0. 34_Z  32/7
1          1         1         1           1771             1771             1771        0  253    0  8855    1    0  8855
2          1         1         1           1771             1771             1771        0  253    0  8855    1    0  8855
3          1         1         1           1771             1771             1771        0  253    0  8855    1    0  8855
4          0         0         0              1                1                1        0    3    0     0    1    0     0
5          0         0         0              1                1                1        0    3    0     0    1    0     0
6          0         0         0              1                1                1        0    3    0     0    1    0     0
7        300       300       300           2300             2300             2300        1  300    0 12650    1    0 12650
8          0         0         0              0                0                0        0    1    0     0    1    0     0
9      -2600     -2600     -2600            -20              -20              -20    -3276   10    0    35    1 7770    35
10         0         0         0              4                4                4        0    6    0     1    1    0     1
11         0         0         0              0                0                0        0    0    0     0    1    0     0
12 286097760 286097760 286097760           5984             5984             5984 52451256  561    0 46376    1    1 46376
13  28048800  28048800  28048800           4960             4960             4960  3365856  496    0 35960    1    0 35960
14   7888725   7888725   7888725           4495             4495             4495   736281  465    0 31465    1    0 31465
15      <NA>      <NA>      <NA>           <NA>             <NA>             <NA>     <NA> <NA> <NA>  <NA> <NA> <NA>  <NA>
16         0         0         0              0                0                0        0    0    0     0    1    0     0
17      -300      -300      -300            -10              -10              -10     -351    6    0    15    1  630    15
   (31 %% 45) NULL   NA  -3L
1           0 <NA>    0    0
2           0 <NA>    0    0
3           0 <NA>    0    0
4           0 <NA>    0    0
5           0 <NA>    0    0
6           0 <NA>    0    0
7           0 <NA>    0    0
8           0 <NA>    0    0
9       -5984 <NA>    0    0
10          0 <NA>    0    0
11          0 <NA>    0    0
12       5984 <NA>    0    0
13         32 <NA>    0    0
14          1 <NA>    0    0
15       <NA> <NA> <NA> <NA>
16          0 <NA>    0    0
17       -528 <NA>    0    0
Antoine Lucas's avatar
import  
Antoine Lucas committed
929
930

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
931
max 
Antoine Lucas's avatar
import  
Antoine Lucas committed
932
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
          23.       23_Z  23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")         25        2.3        -4.         4L
1          23      error error             23            error            error         25         23         23         23
2          23         23    23             23               23               23         25         23         23         23
3          23         23    23             23               23               23         25         23         23         23
4          23      error error             23            error            error         25         23         23         23
5          23         23    23             23               23               23         25         23         23         23
6          23         23    23             23               23               23         25         23         23         23
7          25      error error             25            error            error         25         25         25          4
8          23      error error             23            error            error         25        2.3        2.3          4
9          23      error error             23            error            error         25        2.3         -4          4
10         23      error error             23            error            error          4          4          4          4
11         23      error error             23            error            error         25        2.3          0          4
12         34         34    34             34               34               34         34         34         34         34
13         23         23    23             23               23               23         25       32/7       32/7       32/7
14 (31 %% 45) (31 %% 45)    31     (31 %% 45)       (31 %% 45)               31 (31 %% 45) (31 %% 45) (31 %% 45) (31 %% 45)
15         23      error error             23            error            error         25        2.3         -4          4
16       <NA>      error error           <NA>            error            error       <NA>       <NA>       <NA>       <NA>
17         23      error error             23            error            error         25        2.3         -3          4
           0.       34_Z  32/7 (31 %% 45)       NULL   NA        -3L
1          23      error error      error         23 <NA>         23
2          23         34    23         31         23 <NA>         23
3          23         34    23         31         23 <NA>         23
4          23      error error      error         23 <NA>         23
5          23         34    23         31         23 <NA>         23
6          23         34    23         31         23 <NA>         23
7          25      error error      error         25 <NA>         25
8         2.3      error error      error        2.3 <NA>        2.3
9           0      error error      error         -4 <NA>         -3
10          4      error error      error          4 <NA>          4
11          0      error error      error          0 <NA>          0
12         34         34    34         34         34 <NA>         34
13       32/7         34  32/7         31       32/7 <NA>       32/7
14 (31 %% 45) (34 %% 45)    31 (31 %% 45) (31 %% 45) <NA> (31 %% 45)
15          0      error error      error       -Inf <NA>         -3
16       <NA>      error error      error       <NA> <NA>       <NA>
17          0      error error      error         -3 <NA>         -3
Antoine Lucas's avatar
import  
Antoine Lucas committed
969
970

------------------------------------------
Antoine Lucas's avatar
Antoine Lucas committed
971
min 
Antoine Lucas's avatar
import  
Antoine Lucas committed
972
-> all.equal(target = res, current = F(<numeric x>)):
Antoine Lucas's avatar
Antoine Lucas committed
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
          23.       23_Z  23/1 c("3.", "23.") c("3_Z", "23_Z") c("3/1", "23/1")         25                               2.3
1          23      error error              3            error            error         23                               2.3
2          23         23    23              3                3                3         23                                 2
3          23         23    23              3                3                3         23 2589569785738035/1125899906842624
4           3      error error              3            error            error         25                               2.3
5           3          3     3              3                3                3          3                                 2
6           3          3     3              3                3                3          3 2589569785738035/1125899906842624
7          23      error error             25            error            error         25                               2.3
8         2.3      error error            2.3            error            error        2.3                               2.3
9          -4      error error             -4            error            error         -4                                -4
10          4      error error              3            error            error         25                               2.3
11          0      error error              0            error            error          0                                 0
12         23         23    23              3                3                3         25                                 2
13       32/7       32/7  32/7              3                3                3       32/7 2589569785738035/1125899906842624
14 (23 %% 45) (23 %% 45)    23      (3 %% 45)        (3 %% 45)                3 (25 %% 45)                         (2 %% 45)
15         23      error error              3            error            error         25                               2.3
16       <NA>      error error           <NA>            error            error       <NA>                              <NA>
17         -3      error error             -3            error            error         -3                                -3
          -4.        4L        0.       34_Z  32/7 (31 %% 45)       NULL   NA        -3L
1          -4         4         0      error error      error         23 <NA>         -3
2          -4         4         0         23  32/7         23         23 <NA>         -3
3          -4         4         0         23  32/7         23         23 <NA>         -3
4          -4         3         0      error error      error          3 <NA>         -3
5          -4         3         0          3     3          3          3 <NA>         -3
6          -4         3         0          3     3          3          3 <NA>         -3
7          -4        25         0      error error      error         25 <NA>         -3
8          -4       2.3         0      error error      error        2.3 <NA>         -3
9          -4        -4        -4      error error      error         -4 <NA>         -4
For faster browsing, not all history is shown. View entire blame