inst/tinytest/bc_num/test-integer_overflow.R

# set-up ====
enumerate <- 0L
errorfun <- function(tt) {
  
  if(isFALSE(tt)) stop(print(tt))
}

# overflow ====
expect_equal(
  bc.i(2^53, 1, "+") |> drop(),
  Inf
)

expect_equal(
  bc.i(-2^53, 1, "-") |> drop(),
  -Inf
)
enumerate <- enumerate + 2L

Try the broadcast package in your browser

Any scripts or data that you put into this service are public.

broadcast documentation built on Sept. 15, 2025, 5:08 p.m.