cryptol/examples/builtins.cry

39 lines
443 B
Plaintext
Raw Normal View History

2017-06-27 01:27:36 +03:00
//Here's a test of some builtin operators
//nothing too deep, just making sure they all work out
t : [8]
t = if True then 5 else 4 //5
f : [8]
f = if False then 3 else 5 //5
times : [8]
times = 5 * 1 * 2 * 3 //30
div : [8]
div = (((30/1)/2)/3) //5
mod : [8]
mod = 205%10 //5
exp : [8]
exp = 2^^7 //128
lgtest : [8]
lgtest = lg2 128 //7
p : [8]
p = 3+2 //5
m : [8]
m = 8-3 //5
neg : [8]
neg = -(-5) //5
comp : [8]
comp = ~250 //5