Skip to main content

majority

Function majority 

Source
pub const fn majority(first: bool, second: bool, third: bool) -> bool
Expand description

Returns whether at least two of three inputs are true.

Examples found in repository?
examples/basic_usage.rs (line 9)
3fn main() {
4    assert!(implication(false, true));
5    assert!(equivalence(true, true));
6    assert!(exclusive_or(true, false));
7    assert!(!nand(true, true));
8    assert!(nor(false, false));
9    assert!(majority(true, true, false));
10}