R/fibtest.R

Defines functions getFib

Documented in getFib

getFib <- function(x) {
  if (x == 1 || x == 2) {
    res <- 1
  } else {
    res <- getFib(x-1) + getFib(x-2)
  }
  return(res)
}
kjnorris/fibtestR documentation built on Aug. 3, 2017, 12:34 a.m.