ligo/src/test/contracts/arithmetic.ligo

16 lines
385 B
Plaintext
Raw Normal View History

// Test PascaLIGO arithmetic operators
function mod_op (const n : int) : nat is n mod 42
2019-05-12 20:56:22 +00:00
function plus_op (const n : int) : int is n + 42
2019-05-12 20:56:22 +00:00
function minus_op (const n : int) : int is n - 42
2019-05-12 20:56:22 +00:00
function times_op (const n : int) : int is n * 42
2019-05-12 20:56:22 +00:00
function div_op (const n : int) : int is n / 2
2019-05-12 20:56:22 +00:00
function int_op (const n : nat) : int is int (n)
2019-07-19 12:13:09 +02:00
function neg_op (const n : int) : int is -n