gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/expr-print.lua
diff options
context:
space:
mode:
Diffstat (limited to 'expr-print.lua')
-rw-r--r--expr-print.lua 5
1 files changed, 5 insertions, 0 deletions
diff --git a/expr-print.lua b/expr-print.lua
index 4c73f44d..543ee58a 100644
--- a/expr-print.lua
+++ b/expr-print.lua
@@ -66,6 +66,11 @@ local function eval_operator(op, a, b)
elseif op == '=' then return (a == b and 1 or 0)
elseif op == '>' then return (a > b and 1 or 0)
elseif op == '<' then return (a < b and 1 or 0)
+ elseif op == '!=' then return (a ~= b and 1 or 0)
+ elseif op == '>=' then return (a >= b and 1 or 0)
+ elseif op == '<=' then return (a <= b and 1 or 0)
+ elseif op == 'AND' then return ((a ~= 0 and b ~= 0) and 1 or 0)
+ elseif op == 'OR' then return ((a ~= 0 or b ~= 0) and 1 or 0)
else error('unkown operation: ' .. op) end
end
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月14日 23:43:47 +0000

AltStyle によって変換されたページ (->オリジナル) /