- Check for more error conditions - Move to more definitive error assertions - Simpler error messages in some cases - Test more conditions more thoroughly, revisit old tests
22 lines
383 B
Text
22 lines
383 B
Text
fun worst_fib(n: f64) -> f64 {
|
|
if n == 0 {
|
|
0
|
|
} else if n == 1 {
|
|
1
|
|
} else {
|
|
worst_fib(n-2) + delegate_worst_fib(n-1)
|
|
}
|
|
}
|
|
|
|
// NOTE: This nonsense exists to make sure mutual recursion works, in
|
|
// addition to direct recursion.
|
|
fun delegate_worst_fib(n: f64) -> f64 {
|
|
worst_fib(n)
|
|
}
|
|
|
|
fun test() -> f64 {
|
|
worst_fib(10)
|
|
}
|
|
|
|
// @no-errors
|
|
// @eval: Float(55.0)
|