leo/tests/compiler/field/operator_methods.leo

29 lines
560 B
Plaintext
Raw Normal View History

2022-06-16 23:07:40 +03:00
/*
namespace: Compile
expectation: Pass
input_file:
- inputs/fields.in
*/
@program
2022-06-16 23:07:40 +03:00
function main(a: field, b: field) -> bool {
// unary
2022-06-16 23:22:32 +03:00
let f: field = a.inv();
let g: field = a.neg();
let i: field = a.square();
2022-06-23 10:19:26 +03:00
let j: field = a.square_root();
2022-06-16 23:07:40 +03:00
// binary
2022-06-17 02:56:00 +03:00
let k: field = a.add(b);
2022-06-16 23:22:32 +03:00
let m: field = a.div(b);
2022-06-16 23:07:40 +03:00
let o: bool = a.eq(b);
2022-06-23 10:19:26 +03:00
let p: bool = a.gte(b);
2022-06-16 23:07:40 +03:00
let q: bool = a.gt(b);
2022-06-23 10:19:26 +03:00
let r: bool = a.lte(b);
2022-06-16 23:07:40 +03:00
let s: bool = a.lt(b);
2022-06-16 23:22:32 +03:00
let t: field = a.mul(b);
2022-06-16 23:07:40 +03:00
let w: bool = a.neq(b);
2022-06-16 23:22:32 +03:00
let z: field = a.pow(b);
2022-06-16 23:07:40 +03:00
2022-06-17 01:40:48 +03:00
return w;
2022-06-16 23:07:40 +03:00
}