def int_le

bend-schema-lib@0.4.1.0 · core.bend:328

import bend-schema-lib@0.4.1.0/core.bend as Core
import Base

328# a <= b on integers. A negative is below every non-negative, and between two
329# negatives the larger offset is the smaller number.
330def int_le(a: Int, b: Int) -> Bool:
331  match a b:
332    case IPos{m} IPos{n}:
333      Nat.is_le(m, n)
334    case IPos{m} INeg{n}:
335      False{}
336    case INeg{m} IPos{n}:
337      True{}
338    case INeg{m} INeg{n}:
339      Nat.is_le(n, m)

Uses (3)

Used by (1)