https://github.com/cran/pracma
Raw File
Tip revision: e970b8e92676e0d1f2c84b116f0bad93b03b89c6 authored by Hans W. Borchers on 15 December 2019, 21:30:02 UTC
version 2.2.9
Tip revision: e970b8e
polyint.R
###
### polyint.R  +++ Test suite +++
###


test.polyint <- function(input, expected) {
   output <- do.call(getFromNamespace("polyint", "pracma"), input)
   identical(output, expected)
}

polyint.expected.1 <- c(1, 0)
polyint.expected.2 <- c(1/6, 1/5, 1/4, 1/3, 1/2, 1, 1)

test.polyint(list(p=c(1)), polyint.expected.1)
test.polyint(list(p=c(1,1,1,1,1,1), k=1), polyint.expected.2)
back to top