Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

math.compare (procNode)

Compare two values with a named operator: 1 where the comparison holds, 0 where it does not, element by element. Only the chosen comparison cooks.

Built from math.lt, math.le, math.gt, math.ge, math.eq and math.ne, one of which cooks, chosen by op. op is a plain value, fixed when the graph is built. The orderings compare vectors by their first component; eq and ne compare every component, and two texts. g.compare(a, op, b) of the authoring surface resolves here.

Inputs

  • a (Value, default 0). The left value.
  • op (String, default "eq"). The comparison: lt, le, gt, ge, eq, ne (also neq), or the symbols <, <=, >, >=, ==, ~=, !=.
  • b (Value, default 0). The right value.

Outputs

  • value. 1 or 0.
local value = g.math.compare(1, "<", 2) -- 1