Deleted standalone fibonacci test
This commit is contained in:
parent
7ef5b4dfbf
commit
7c8ec4bc6c
51
tests/fib.pn
51
tests/fib.pn
|
@ -1,51 +0,0 @@
|
|||
operator `<`(a, b: int): bool {
|
||||
#pragma[magic: "LessThanInt64", pure]
|
||||
}
|
||||
|
||||
|
||||
operator `-`(a, b: float): float {
|
||||
#pragma[magic: "SubFloat64", pure]
|
||||
}
|
||||
|
||||
|
||||
operator `-`(a, b: int): int {
|
||||
#pragma[magic: "SubInt64", pure]
|
||||
}
|
||||
|
||||
|
||||
operator `+`(a, b: int): int {
|
||||
#pragma[magic: "AddInt64", pure]
|
||||
}
|
||||
|
||||
|
||||
operator `/`(a, b: int): int {
|
||||
#pragma[magic: "DivInt64", pure]
|
||||
}
|
||||
|
||||
|
||||
fn clock: float {
|
||||
#pragma[magic: "SysClock64", pure]
|
||||
}
|
||||
|
||||
|
||||
fn print(x: float) {
|
||||
#pragma[magic: "GenericPrint"]
|
||||
}
|
||||
|
||||
|
||||
fn print(x: int) {
|
||||
#pragma[magic: "GenericPrint"]
|
||||
}
|
||||
|
||||
|
||||
fn fib(n: int): int {
|
||||
if n < 2 {
|
||||
return n;
|
||||
}
|
||||
return fib(n - 2) + fib(n - 1);
|
||||
}
|
||||
|
||||
|
||||
var x = clock();
|
||||
print(fib(25));
|
||||
print(clock() - x);
|
Loading…
Reference in New Issue