52 lines
705 B
Plaintext
52 lines
705 B
Plaintext
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);
|