mirror of
https://github.com/fluencelabs/aqua-lib
synced 2024-12-04 23:30:22 +00:00
feat: add and, or and not (#31)
This commit is contained in:
parent
c48bf22d0d
commit
9870e454a2
25
binary.aqua
Normal file
25
binary.aqua
Normal file
@ -0,0 +1,25 @@
|
||||
-- TODO: add aqua tests
|
||||
|
||||
func and(l: bool, r: bool) -> bool:
|
||||
res: ?bool
|
||||
if l:
|
||||
res <<- r
|
||||
else:
|
||||
res <<- false
|
||||
<- res!
|
||||
|
||||
func or(l: bool, r: bool) -> bool:
|
||||
res: ?bool
|
||||
if l:
|
||||
res <<- true
|
||||
else:
|
||||
res <<- r
|
||||
<- res!
|
||||
|
||||
func not(u: bool) -> bool:
|
||||
res: ?bool
|
||||
if u:
|
||||
res <<- false
|
||||
else:
|
||||
res <<- true
|
||||
<- res!
|
@ -4,7 +4,8 @@
|
||||
"description": "Aqua standard library",
|
||||
"files": [
|
||||
"builtin.aqua",
|
||||
"math.aqua"
|
||||
"math.aqua",
|
||||
"binary.aqua"
|
||||
],
|
||||
"scripts": {},
|
||||
"repository": {
|
||||
|
Loading…
Reference in New Issue
Block a user