tests/testthat/test-bernstein-approx.R

context("bernstein_approx()")


test_that("bernstein_approx() works", {
  
  expect_equal(
    bernstein_approx(function(x) x^4, 2L),
    mp(".125 x + .875 x^2")
  )
  
  expect_equal(
    suppressWarnings(bernsteinApprox(function(x) x^4, 2L)),
    mp(".125 x + .875 x^2")
  )
  
})

Try the mpoly package in your browser

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

mpoly documentation built on March 26, 2020, 7:33 p.m.