pub fn quantize(x: f64, valence: u32, lo: f64, hi: f64) -> f64Expand description
Quantize a value to N discrete levels in range [lo, hi]. For N=2 (Boolean): levels are {lo, hi} For N=3 (ternary): levels are {lo, mid, hi} For N<2 (continuous/unary): no quantization See: https://en.wikipedia.org/wiki/Many-valued_logic