leo/tests/compiler/field/operator_methods.leo

27 lines
514 B
Plaintext
Raw Normal View History

2022-06-16 23:07:40 +03:00
/*
namespace: Compile
expectation: Pass
input_file:
- inputs/fields.in
*/
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-16 23:07:40 +03:00
// binary
2022-06-16 23:22:32 +03:00
let j: field = a.add(b);
let m: field = a.div(b);
2022-06-16 23:07:40 +03:00
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
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
}