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

updated func

- updated func
- deleted autogenerated files from git
- updated liteclient
- increase state sync timeout
This commit is contained in:
ton 2019-10-16 13:00:43 +04:00
parent c50074fd55
commit 9c9248a9ae
28 changed files with 302 additions and 2465 deletions

View file

@ -59,20 +59,20 @@ operator _/%_ infix 20;
return (x / y, x % y);
}
-}
{-
< type A, type B, type C >
forall A, B, C ->
(B, C, A) rot (A x, B y, C z) {
return (y, z, x);
}
-}
int ataninv(int base, int q) { ;; computes base*atan(1/q)
base /~= q;
base ~/= q;
q *= - q;
int sum = 0;
int n = 1;
do {
sum += base /~ n;
base /~= q;
sum += base ~/ n;
base ~/= q;
n += 2;
} until base == 0;
return sum;
@ -81,5 +81,9 @@ int ataninv(int base, int q) { ;; computes base*atan(1/q)
int calc_pi() {
int base = 64;
repeat (70) { base *= 10; }
return (ataninv(base << 2, 5) - ataninv(base, 239)) >>~ 4;
return (ataninv(base << 2, 5) - ataninv(base, 239)) ~>> 4;
}
int main() {
return calc_pi();
}

22
crypto/func/test/a6_3.fc Normal file
View file

@ -0,0 +1,22 @@
forall A, B, C ->
(B, C, A) rot(A x, B y, C z) {
return (y, z, x);
}
forall A, B, C ->
_ rot2(A x, B y, C z) {
return rot(rot(x, y, z));
}
_ test() {
return rot2(2, 3, 9);
}
_ test2(cell x, slice y, tuple z) {
return rot2(x, y, z);
}
forall A ->
_ test3(cell x, A y, int z) {
return rot2(x, y, z);
}