bit64 (version 4.0.5)

all.equal.integer64: Test if two integer64 vectors are all.equal

Description

A utility to compare integer64 objects 'x' and 'y' testing for <U+2018>near equality<U+2019>, see all.equal.

Usage

# S3 method for integer64
all.equal(
  target
, current
, tolerance = sqrt(.Machine$double.eps)
, scale = NULL
, countEQ = FALSE
, formatFUN = function(err, what) format(err)
, ...
, check.attributes = TRUE
)

Arguments

target

a vector of 'integer64' or an object that can be coerced with as.integer64

current

a vector of 'integer64' or an object that can be coerced with as.integer64

tolerance

numeric \(\ge\) 0. Differences smaller than tolerance are not reported. The default value is close to 1.5e-8.

scale

NULL or numeric > 0, typically of length 1 or length(target). See ‘Details’.

countEQ

logical indicating if the target == current cases should be counted when computing the mean (absolute or relative) differences. The default, FALSE may seem misleading in cases where target and current only differ in a few places; see the extensive example.

formatFUN

a function of two arguments, err, the relative, absolute or scaled error, and what, a character string indicating the kind of error; maybe used, e.g., to format relative and absolute errors differently.

further arguments are ignored

check.attributes

logical indicating if the attributes of target and current (other than the names) should be compared.

Value

Either <U+2018>TRUE<U+2019> (<U+2018>NULL<U+2019> for <U+2018>attr.all.equal<U+2019>) or a vector of <U+2018>mode<U+2019> <U+2018>"character"<U+2019> describing the differences between <U+2018>target<U+2019> and <U+2018>current<U+2019>.

Details

In all.equal.numeric the type integer is treated as a proper subset of double i.e. does not complain about comparing integer with double. Following this logic all.equal.integer64 treats integer as a proper subset of integer64 and does not complain about comparing integer with integer64. double also compares without warning as long as the values are within lim.integer64, if double are bigger all.equal.integer64 complains about the all.equal.integer64 overflow warning. For further details see all.equal.

See Also

all.equal

Examples

Run this code
# NOT RUN {
  all.equal(as.integer64(1:10), as.integer64(0:9))
  all.equal(as.integer64(1:10), as.integer(1:10))
  all.equal(as.integer64(1:10), as.double(1:10))
  all.equal(as.integer64(1), as.double(1e300))
# }

Run the code above in your browser using DataCamp Workspace