From 69a6b78c877397553d28bd52b0eb671193a040b2 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 3 Jan 2022 10:36:52 -0800 Subject: [PATCH] Apply upstream r-81436 to fix all.equal.integer64 --- R/integer64.R | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/R/integer64.R b/R/integer64.R index d2d8eda..e080fe4 100644 --- a/R/integer64.R +++ b/R/integer64.R @@ -1718,22 +1718,21 @@ all.equal.integer64 <- function ( current <- current[!out] if (!countEQ) N <- length(target) - xy <- sum(abs(target - current))/N what <- if (is.null(scale)) { - xn <- (sabst0 + sum(abs(target)))/N - if (is.finite(xn) && xn > tolerance) { - xy <- xy/xn + scale <- (sabst0 + sum(abs(target)))/N + if (is.finite(scale) && scale > tolerance) { "relative" } else { + scale <- 1 "absolute" } } else { stopifnot(all(scale > 0)) - xy <- xy/scale if (all(abs(scale - 1) < 1e-07)) "absolute" else "scaled" } + xy <- sum(abs(target - current)/(N*scale)) if (is.na(xy) || xy > tolerance) msg <- c(msg, paste("Mean", what, "difference:", formatFUN(xy, what))) if (is.null(msg)) {