mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-16 11:22:33 +03:00
39 lines
443 B
Plaintext
39 lines
443 B
Plaintext
|
//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
|
||
|
|
||
|
|
||
|
|