search for: bigq

Displaying 8 results from an estimated 8 matches for "bigq".

Did you mean: big
2023 Jan 07
2
gmp::bigq vs. MASS::fractions
Hi, has someone experience which routine should be used for creating fractional numbers? The two conversion routines deliver different results > x <- (0:7)/7 > MASS::fractions(x) [1] 0 1/7 2/7 3/7 4/7 5/7 6/7 1 > gmp::as.bigq(x) Big Rational ('bigq') object of length 8: [1] 0 2573485501354569/18014398509481984 2573485501354569/9007199254740992 [4] 7720456504063707/18014398509481984 2573485501354569/4503599627370496 6433713753386423/9007199254740992 [7] 7720456504063707/9007199254740992 1 Following the...
2023 Jan 07
1
gmp::bigq vs. MASS::fractions
On Sat, 7 Jan 2023 17:29:35 +0100 Sigbert Klinke <sigbert at wiwi.hu-berlin.de> wrote: > > x <- (0:7)/7 > > > MASS::fractions(x) > > [1] 0 1/7 2/7 3/7 4/7 5/7 6/7 1 > > > gmp::as.bigq(x) > > Big Rational ('bigq') object of length 8: > > [1] 0 > 2573485501354569/18014398509481984 2573485501354569/9007199254740992 > > [4] 7720456504063707/18014398509481984 > 2573485501354569/4503599627370496 6433713753386423/9007199254740992 > > [7] 772...
2007 Jun 25
3
fractional calculations
Hi All, is there a function in R that allows me to work with fractions without transforming them to floats (or whatever) in between? Something that would calculate something like: (1/2 + 1/8) * 1/2 = 5/16 without ever transforming to 0.5 and 0.125? Best, Federico -- Federico C. F. Calboli Department of Epidemiology and Public Health Imperial College, St Mary's Campus Norfolk Place,
2018 Mar 16
1
Discrepancy: R sum() VS C or Fortran sum
...R sum does in fact match the result if we use the Kahan algorithm. P. I am glad to see that R sum() is more accurate than the gfortran compiler sum. On 16/03/18 11:37 AM, luke-tierney at uiowa.edu wrote: > Install the gmp package, run your code, and then try this: > > bu <- gmp::as.bigq(u) > bs4 <- bu[1] + bu[2] + bu[3] + bu[4] + bu[5] > s4 <- as.double(bs4) > s1 - s4 > ## [1] 0 > s2[[2]] - s4 > ## [1] 7.105427e-15 > s3 - s4 > ## [1] 7.105427e-15 > identical(s1, s4) > ## [1] TRUE > > `bs4` is the exact sum of the binary rationals in yo...
2012 Mar 28
1
rep with bigz in gmp
Hi With package:gmp, is this an expected behavior? > rep(1:3, rep(3, 3)) [1] 1 1 1 2 2 2 3 3 3 > rep(as.bigz(1:3), rep(3, 3)) Big Integer ('bigz') object of length 9: [1] 1 2 3 1 2 3 1 2 3 This code is used inside `outer`, so more worse > outer(1:3, 1:3, `*`) [,1] [,2] [,3] [1,] 1 2 3 [2,] 2 4 6 [3,] 3 6 9 > outer(as.bigz(1:3),
2018 Mar 16
0
Discrepancy: R sum() VS C or Fortran sum
Install the gmp package, run your code, and then try this: bu <- gmp::as.bigq(u) bs4 <- bu[1] + bu[2] + bu[3] + bu[4] + bu[5] s4 <- as.double(bs4) s1 - s4 ## [1] 0 s2[[2]] - s4 ## [1] 7.105427e-15 s3 - s4 ## [1] 7.105427e-15 identical(s1, s4) ## [1] TRUE `bs4` is the exact sum of the binary rationals in your `u` vector; `s4` is the closest double precision to this...
2018 Mar 16
3
Discrepancy: R sum() VS C or Fortran sum
Hi all, I found a discrepancy between the sum() in R and either a sum done in C or Fortran for vector of just 5 elements. The difference is very small, but this is a very small part of a much larger numerical problem in which first and second derivatives are computed numerically. This is part of a numerical method course I am teaching in which I want to compare speeds of R versus Fortran (We
2013 Dec 02
1
pesky \usage-warnings with R CMD check
...hrough \code{eval}), \code{numeric} (including \code{INF} and \code{NaN}), \code{complex} (including \code{INF}), \code{matrix}, \code{array}, \code{list}, \code{pairlist}, \code{table}, \code{data.frame}, \code{lm}, \code{randomForest}, \code{randomForest.formula}, \code{ts}, \code{bigz} and \code{bigq} from package \code{gmp}, \code{int64} and \code{uint64} from package \code{int64}, and \code{integer64} from package \code{bit64}. Other classes are processed with \code{as.character( value )}. Table-like structures defines three commands for each structure: \code{nameColumns,} that can be used...