def sign
import bend-collections@1.0.0.0/src/math/generic.bend as Genericimport Base
import bend-collections@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 (0)
No other definition uses this definition.