def sign

bend-collections-laws-crypto@1.0.0.0 · src/math/generic.bend:114

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

114# 1 above zero, -1 below, x itself otherwise (0, -0.0, NaN)
115def sign(~T: Data, ~op: N.Op<T> -> T, ~test: N.Test<T> -> Bool, +x: T) -> T:
116  sign_above(~T, ~op, ~test, x, test(N.Lt{op(N.ZeroOp{}), x}))

Uses (4)

Used by (2)