def sign_below

bend-collections@1.0.0.0 · src/math/generic.bend:100

import bend-collections@1.0.0.0/src/math/generic.bend as Generic
import Base
import bend-collections@1.0.0.0/src/math/num.bend as N

100def sign_below(~T: Data, ~op: N.Op<T> -> T, ~test: N.Test<T> -> Bool, +x: T, below: Bool) -> T:
101  match below:
102    case True{}:
103      op(N.Neg{op(N.One{})})
104    case False{}:
105      x

Uses (3)

Used by (1)