summaryrefslogtreecommitdiff
path: root/fib.kpl
diff options
context:
space:
mode:
Diffstat (limited to 'fib.kpl')
-rw-r--r--fib.kpl8
1 files changed, 4 insertions, 4 deletions
diff --git a/fib.kpl b/fib.kpl
index cb6b5ef..8f003ee 100644
--- a/fib.kpl
+++ b/fib.kpl
@@ -1,19 +1,19 @@
/*
Fibonacci sequence
- n can be any signed or unsigned integer type
+ n can be any numeric type
*/
`export fib : Fn[n] $ (
t : `type n
? {
- t = Int[Any; .signed; Any] {
+ |(t = Int_signed; t = Float) {
? n <= 0 { `return 0 }
}
- t = Int[Any; .unsigned; Any] {
+ t = Int_unsigned {
? n = 0 { `return 0 }
}
- { `panic "n must be a signed or unsigned Int" }
+ { `panic "invalid type for n" }
}
? {
n < 3 { 2 }