inst/tests/testthat_hypotenuse_tests.R

expect_equal(learningr::hypotenuse(3, 4), 5)
expect_error(learningr::hypotenuse())
expect_equal(
  learningr::hypotenuse(1e-300, 1e-300), 
  sqrt(2) * 1e-300, 
  tol = 1e-305
)
expect_equal(learningr::hypotenuse(1e300, 1e300), sqrt(2) * 1e300)

Try the learningr package in your browser

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

learningr documentation built on Oct. 2, 2019, 5:04 p.m.