Function halo2_gadgets::utilities::ternary
source · pub fn ternary<F: Field>(
a: Expression<F>,
b: Expression<F>,
c: Expression<F>
) -> Expression<F>
Expand description
If a
then b
, else c
. Returns (a * b) + (1 - a) * c.
a
must be a boolean-constrained expression.