1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-15 04:32:21 +00:00
ton/tolk-tester/tests/a6_5.tolk

27 lines
396 B
Text
Raw Normal View History

@deprecated
fun twice(f: int -> int, x: int) {
return f (f (x));
}
fun sqr(x: int) {
return x * x;
}
fun main(x: int): int {
var f = sqr;
return twice(f, x) * f(x);
}
@method_id(4)
fun pow6(x: int): int {
return twice(sqr, x) * sqr(x);
}
/**
method_id | in | out
@testcase | 0 | 3 | 729
@testcase | 0 | 10 | 1000000
@testcase | 4 | 3 | 729
@testcase | 4 | 10 | 1000000
*/