MCPcopy Create free account
hub / github.com/Dobiasd/FunctionalPlus / fibo

Function fibo

test/composition_test.cpp:23–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21typedef IntCont Row;
22
23std::uint64_t fibo(std::uint64_t n)
24{
25 if (n < 2)
26 return n;
27 else
28 return fibo(n - 1) + fibo(n - 2);
29}
30// version using continuation passing style (CPS)
31std::uint64_t fibo_cont(const std::function<std::uint64_t(std::uint64_t)>& cont, std::uint64_t n)
32{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected