inst/tinytest/test_round_half_away_from_zero.R

if (interactive()) {
  pkgload::load_all()
  library("tinytest")
}


x <- 22.5
expect_equal(round_half_away_from_zero(x), 23)
expect_equal(base::round(x), 22)
expect_equal(round_half_away_from_zero(-x), -23)
expect_equal(base::round(-x), -22)

Try the fritools2 package in your browser

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

fritools2 documentation built on July 9, 2023, 7:07 p.m.