1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

[FunC] Apply camelCase to some tests to ensure code_hash remains unchanged

In auto-tests, @code_hash controls bytecode stability.
In legacy tests, expected hashes are specified in a separate file.
This commit is contained in:
Aleksandr Kirsanov 2024-04-27 19:50:51 +05:00
parent c74e49d467
commit a174f858be
No known key found for this signature in database
GPG key ID: B758BBAA01FFB3D3
8 changed files with 85 additions and 38 deletions

View file

@ -6,6 +6,8 @@
return (Dx / D, Dy / D);
}
int mulDivR(int x, int y, int z) { return muldivr(x, y, z); }
int calc_phi() {
var n = 1;
repeat (70) { n *= 10; }
@ -13,7 +15,7 @@ int calc_phi() {
do {
(p, q) = (q, p + q);
} until (q > n);
return muldivr(p, n, q);
return mulDivR(p, n, q);
}
int calc_sqrt2() {
@ -24,7 +26,7 @@ int calc_sqrt2() {
var t = p + q;
(p, q) = (q, t + q);
} until (q > n);
return muldivr(p, n, q);
return mulDivR(p, n, q);
}
var calc_root(m) {
@ -73,14 +75,18 @@ int ataninv(int base, int q) { ;; computes base*atan(1/q)
return sum;
}
int arctanInv(int base, int q) { return ataninv(base, q); }
int calc_pi() {
int base = 64;
repeat (70) { base *= 10; }
return (ataninv(base << 2, 5) - ataninv(base, 239)) ~>> 4;
return (arctanInv(base << 2, 5) - arctanInv(base, 239)) ~>> 4;
}
int calcPi() { return calc_pi(); }
int main() {
return calc_pi();
return calcPi();
}
{-