def sign_a

bend-collections-laws-math@1.0.0.0 · proofs/math/typed/float.bend:65

import bend-collections-laws-math@1.0.0.0/proofs/math/typed/float.bend as Float
import Base
import bend-collections-laws-math@1.0.0.0/spec/math/generic.bend as SG
import bend-collections-laws-math@1.0.0.0/src/math/generic.bend as G
import bend-collections-laws-math@1.0.0.0/src/math/num.bend as N

65def sign_a(~T: Data, ~op: N.Op<T> -> T, ~test: N.Test<T> -> Bool, +x: T, +c: Bool) -> {G.sign_above(~T, ~op, ~test, x, c) == SG.pick(T, c, op(N.One{}), SG.pick(T, test(N.Lt{x, op(N.ZeroOp{})}), op(N.Neg{op(N.One{})}), x)) : T}:
66  match c:
67    case True{}:
68      {==}
69    case False{}:
70      sign_b(~T, ~op, ~test, x, test(N.Lt{x, op(N.ZeroOp{})}))

Uses (6)

Used by (1)