bolt/stdlib/math.bolt

13 lines
148 B
Text
Raw Normal View History

2020-03-03 14:53:54 +01:00
import "./numbers.bolt";
// precedence a + b < a * b;
pub fn fac(n: I) -> I where I: int {
match n {
0 => 1,
i => i * fac(i-1),
2020-03-03 14:53:54 +01:00
}
}