MCPcopy Create free account
hub / github.com/expr-lang/expr / fib

Function fib

expr_test.go:462–467  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

460}
461
462func fib(n int) int {
463 if n <= 1 {
464 return n
465 }
466 return fib(n-1) + fib(n-2)
467}
468
469func ExampleConstExpr() {
470 code := `[fib(5), fib(3+3), fib(dyn)]`

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected