Documentation
¶
Overview ¶
Boolean data type has two possible truth values to represent logic.
📦 Package: https://pkg.go.dev/github.com/golangf/extra-boolean
Index ¶
- func And(a bool, b bool) bool
- func And0() bool
- func And1(a bool) bool
- func And2(a bool, b bool) bool
- func And3(a bool, b bool, c bool) bool
- func And4(a bool, b bool, c bool, d bool) bool
- func And5(a bool, b bool, c bool, d bool, e bool) bool
- func And6(a bool, b bool, c bool, d bool, e bool, f bool) bool
- func And7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) bool
- func And8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) bool
- func Count(a bool, b bool) int
- func Count0() int
- func Count1(a bool) int
- func Count2(a bool, b bool) int
- func Count3(a bool, b bool, c bool) int
- func Count4(a bool, b bool, c bool, d bool) int
- func Count5(a bool, b bool, c bool, d bool, e bool) int
- func Count6(a bool, b bool, c bool, d bool, e bool, f bool) int
- func Count7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) int
- func Count8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) int
- func Eq(a bool, b bool) bool
- func Eqv(a bool, b bool) bool
- func Imp(a bool, b bool) bool
- func Imply(a bool, b bool) bool
- func Nand(a bool, b bool) bool
- func Nand0() bool
- func Nand1(a bool) bool
- func Nand2(a bool, b bool) bool
- func Nand3(a bool, b bool, c bool) bool
- func Nand4(a bool, b bool, c bool, d bool) bool
- func Nand5(a bool, b bool, c bool, d bool, e bool) bool
- func Nand6(a bool, b bool, c bool, d bool, e bool, f bool) bool
- func Nand7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) bool
- func Nand8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) bool
- func Neq(a bool, b bool) bool
- func Nimply(a bool, b bool) bool
- func Nor(a bool, b bool) bool
- func Nor0() bool
- func Nor1(a bool) bool
- func Nor2(a bool, b bool) bool
- func Nor3(a bool, b bool, c bool) bool
- func Nor4(a bool, b bool, c bool, d bool) bool
- func Nor5(a bool, b bool, c bool, d bool, e bool) bool
- func Nor6(a bool, b bool, c bool, d bool, e bool, f bool) bool
- func Nor7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) bool
- func Nor8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) bool
- func Not(a bool) bool
- func Or(a bool, b bool) bool
- func Or0() bool
- func Or1(a bool) bool
- func Or2(a bool, b bool) bool
- func Or3(a bool, b bool, c bool) bool
- func Or4(a bool, b bool, c bool, d bool) bool
- func Or5(a bool, b bool, c bool, d bool, e bool) bool
- func Or6(a bool, b bool, c bool, d bool, e bool, f bool) bool
- func Or7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) bool
- func Or8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) bool
- func Parse(s string) bool
- func Select(i int, a bool, b bool) bool
- func Select0(i int) bool
- func Select1(i int, a bool) bool
- func Select2(i int, a bool, b bool) bool
- func Select3(i int, a bool, b bool, c bool) bool
- func Select4(i int, a bool, b bool, c bool, d bool) bool
- func Select5(i int, a bool, b bool, c bool, d bool, e bool) bool
- func Select6(i int, a bool, b bool, c bool, d bool, e bool, f bool) bool
- func Select7(i int, a bool, b bool, c bool, d bool, e bool, f bool, g bool) bool
- func Select8(i int, a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) bool
- func Xnor(a bool, b bool) bool
- func Xnor0() bool
- func Xnor1(a bool) bool
- func Xnor2(a bool, b bool) bool
- func Xnor3(a bool, b bool, c bool) bool
- func Xnor4(a bool, b bool, c bool, d bool) bool
- func Xnor5(a bool, b bool, c bool, d bool, e bool) bool
- func Xnor6(a bool, b bool, c bool, d bool, e bool, f bool) bool
- func Xnor7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) bool
- func Xnor8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) bool
- func Xor(a bool, b bool) bool
- func Xor0() bool
- func Xor1(a bool) bool
- func Xor2(a bool, b bool) bool
- func Xor3(a bool, b bool, c bool) bool
- func Xor4(a bool, b bool, c bool, d bool) bool
- func Xor5(a bool, b bool, c bool, d bool, e bool) bool
- func Xor6(a bool, b bool, c bool, d bool, e bool, f bool) bool
- func Xor7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) bool
- func Xor8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) bool
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func And ¶ added in v0.1.0
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
Example ¶
fmt.Println(And(true, true)) // true fmt.Println(And(true, false)) // false fmt.Println(And4(true, true, true, true)) // true fmt.Println(And4(true, false, true, true)) // false
Output: true false true false
func And0 ¶ added in v0.1.0
func And0() bool
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
func And1 ¶ added in v0.1.0
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
func And2 ¶ added in v0.1.0
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
func And3 ¶ added in v0.1.0
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
func And4 ¶ added in v0.1.0
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
func And5 ¶ added in v0.1.0
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
func And6 ¶ added in v0.1.0
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
func And7 ¶ added in v0.1.0
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
func And8 ¶ added in v0.1.0
Checks if all values are true.
// And[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
And(true, true) == true And(true, false) == false And4(true, true, true, true) == true And4(true, false, true, true) == false
func Count ¶ added in v0.1.0
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
Example ¶
fmt.Println(Count(true, true)) // 2 fmt.Println(Count(true, false)) // 1 fmt.Println(Count4(true, true, true, false)) // 3 fmt.Println(Count4(false, true, false, false)) // 1
Output: 2 1 3 1
func Count0 ¶ added in v0.1.0
func Count0() int
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
func Count1 ¶ added in v0.1.0
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
func Count2 ¶ added in v0.1.0
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
func Count3 ¶ added in v0.1.0
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
func Count4 ¶ added in v0.1.0
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
func Count5 ¶ added in v0.1.0
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
func Count6 ¶ added in v0.1.0
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
func Count7 ¶ added in v0.1.0
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
func Count8 ¶ added in v0.1.0
Counts no. of true values.
// Count[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Count(true, true) == 2 Count(true, false) == 1 Count4(true, true, true, false) == 3 Count4(false, true, false, false) == 1
func Eq ¶ added in v0.0.3
Checks if antecedent ⇔ consequent (a ⇔ b).
// Eq(a, b) // a: antecedent // b: consequent
Example:
Eq(true, true) == true Eq(false, false) == true Eq(true, false) == false Eq(false, true) == false
Example ¶
fmt.Println(Eq(true, true)) // true fmt.Println(Eq(false, false)) // true fmt.Println(Eq(true, false)) // false fmt.Println(Eq(false, true)) // false
Output: true true false false
func Eqv ¶ added in v0.1.0
Checks if antecedent ⇔ consequent (a ⇔ b).
// Eqv(a, b) // a: antecedent // b: consequent
Example:
Eqv(true, true) == true Eqv(false, false) == true Eqv(true, false) == false Eqv(false, true) == false
Example ¶
fmt.Println(Eqv(true, true)) // true fmt.Println(Eqv(false, false)) // true fmt.Println(Eqv(true, false)) // false fmt.Println(Eqv(false, true)) // false
Output: true true false false
func Imp ¶ added in v0.1.0
Checks if antecedent ⇒ consequent (a ⇒ b).
// Imp(a, b) // a: antecedent // b: consequent
Example:
Imp(true, true) == true Imp(false, true) == true Imp(false, false) == true Imp(true, false) == false
Example ¶
fmt.Println(Imp(true, true)) // true fmt.Println(Imp(false, true)) // true fmt.Println(Imp(false, false)) // true fmt.Println(Imp(true, false)) // false
Output: true true true false
func Imply ¶ added in v0.0.3
Checks if antecedent ⇒ consequent (a ⇒ b).
// Imply(a, b) // a: antecedent // b: consequent
Example:
Imply(true, true) == true Imply(false, true) == true Imply(false, false) == true Imply(true, false) == false
Example ¶
fmt.Println(Imply(true, true)) // true fmt.Println(Imply(false, true)) // true fmt.Println(Imply(false, false)) // true fmt.Println(Imply(true, false)) // false
Output: true true true false
func Nand ¶ added in v0.1.0
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
Example ¶
fmt.Println(Nand(true, false)) // true fmt.Println(Nand(true, true)) // false fmt.Println(Nand4(true, true, false, true)) // true fmt.Println(Nand4(true, true, true, true)) // false
Output: true false true false
func Nand0 ¶ added in v0.1.0
func Nand0() bool
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
func Nand1 ¶ added in v0.1.0
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
func Nand2 ¶ added in v0.1.0
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
func Nand3 ¶ added in v0.1.0
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
func Nand4 ¶ added in v0.1.0
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
func Nand5 ¶ added in v0.1.0
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
func Nand6 ¶ added in v0.1.0
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
func Nand7 ¶ added in v0.1.0
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
func Nand8 ¶ added in v0.1.0
Checks if any value is false.
// Nand[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nand(true, false) == true Nand(true, true) == false Nand4(true, true, false, true) == true Nand4(true, true, true, true) == false
func Neq ¶ added in v0.0.3
Checks if antecedent ⇎ consequent (a ⇎ b).
// Neq(a, b) // a: antecedent // b: consequent
Example:
Neq(true, false) == true Neq(false, true) == true Neq(true, true) == false Neq(false, false) == false
Example ¶
fmt.Println(Neq(true, false)) // true fmt.Println(Neq(false, true)) // true fmt.Println(Neq(true, true)) // false fmt.Println(Neq(false, false)) // false
Output: true true false false
func Nimply ¶ added in v0.0.3
Checks if antecedent ⇏ consequent (a ⇏ b).
// Nimply(a, b) // a: antecedent // b: consequent
Example:
Nimply(true, false) == true Nimply(true, true) == false Nimply(false, true) == false Nimply(false, false) == false
Example ¶
fmt.Println(Nimply(true, false)) // true fmt.Println(Nimply(true, true)) // false fmt.Println(Nimply(false, true)) // false fmt.Println(Nimply(false, false)) // false
Output: true false false false
func Nor ¶ added in v0.1.0
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
Example ¶
fmt.Println(Nor(false, false)) // true fmt.Println(Nor(true, false)) // false fmt.Println(Nor4(false, false, false, false)) // true fmt.Println(Nor4(false, false, true, false)) // false
Output: true false true false
func Nor0 ¶ added in v0.1.0
func Nor0() bool
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
func Nor1 ¶ added in v0.1.0
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
func Nor2 ¶ added in v0.1.0
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
func Nor3 ¶ added in v0.1.0
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
func Nor4 ¶ added in v0.1.0
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
func Nor5 ¶ added in v0.1.0
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
func Nor6 ¶ added in v0.1.0
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
func Nor7 ¶ added in v0.1.0
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
func Nor8 ¶ added in v0.1.0
Checks if all values are false.
// Nor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Nor(false, false) == true Nor(true, false) == false Nor4(false, false, false, false) == true Nor4(false, false, true, false) == false
func Not ¶ added in v0.0.3
Checks if value is false.
// Not(a, b) // a: a boolean
Example:
Not(false) == true Not(true) == false
Example ¶
fmt.Println(Not(false)) // true fmt.Println(Not(true)) // false
Output: true false
func Or ¶ added in v0.1.0
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
Example ¶
fmt.Println(Or(true, false)) // true fmt.Println(Or(false, false)) // false fmt.Println(Or4(false, true, false, true)) // true fmt.Println(Or4(false, false, false, false)) // false
Output: true false true false
func Or0 ¶ added in v0.1.0
func Or0() bool
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
func Or1 ¶ added in v0.1.0
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
func Or2 ¶ added in v0.1.0
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
func Or3 ¶ added in v0.1.0
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
func Or4 ¶ added in v0.1.0
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
func Or5 ¶ added in v0.1.0
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
func Or6 ¶ added in v0.1.0
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
func Or7 ¶ added in v0.1.0
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
func Or8 ¶ added in v0.1.0
Checks if any value is true.
// Or[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Or(true, false) == true Or(false, false) == false Or4(false, true, false, true) == true Or4(false, false, false, false) == false
func Parse ¶ added in v0.0.1
Converts string to boolean.
// Parse(s) // s: a string
Example:
Parse("1") == true Parse("truthy") == true Parse("Not Off") == true Parse("Not Inactive") == true Parse("cold") == false Parse("inactive") == false Parse("Negative Yes") == false Parse("Negative Aye") == false
Example ¶
fmt.Println(Parse("1")) // true fmt.Println(Parse("truthy")) // true fmt.Println(Parse("Not Off")) // true fmt.Println(Parse("Not Inactive")) // true fmt.Println(Parse("cold")) // false fmt.Println(Parse("inactive")) // false fmt.Println(Parse("Negative Yes")) // false fmt.Println(Parse("Negative Aye")) // false
Output: true true true true false false false false
func Select ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
Example ¶
fmt.Println(Select(0, true, false)) // true fmt.Println(Select(1, true, false)) // false fmt.Println(Select4(1, true, true, false, false)) // true fmt.Println(Select4(2, true, true, false, false)) // false
Output: true false true false
func Select0 ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
func Select1 ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
func Select2 ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
func Select3 ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
func Select4 ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
func Select5 ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
func Select6 ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
func Select7 ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
func Select8 ¶ added in v0.1.0
Checks if ith value is true.
// Select[n](i, a, b, ...) // i: index // a: 1st boolean // b: 2nd boolean
Example:
Select(0, true, false) == true Select(1, true, false) == false Select4(1, true, true, false, false) == true Select4(2, true, true, false, false) == false
func Xnor ¶ added in v0.1.0
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
Example ¶
fmt.Println(Xnor(true, true)) // true fmt.Println(Xnor(false, true)) // false fmt.Println(Xnor4(true, true, false, false)) // true fmt.Println(Xnor4(true, true, true, false)) // false
Output: true false true false
func Xnor0 ¶ added in v0.1.0
func Xnor0() bool
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
func Xnor1 ¶ added in v0.1.0
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
func Xnor2 ¶ added in v0.1.0
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
func Xnor3 ¶ added in v0.1.0
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
func Xnor4 ¶ added in v0.1.0
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
func Xnor5 ¶ added in v0.1.0
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
func Xnor6 ¶ added in v0.1.0
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
func Xnor7 ¶ added in v0.1.0
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
func Xnor8 ¶ added in v0.1.0
Checks if even no. of values are true.
// Xnor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xnor(true, true) == true Xnor(false, true) == false Xnor4(true, true, false, false) == true Xnor4(true, true, true, false) == false
func Xor ¶ added in v0.1.0
Checks if odd no. of values are true.
// Xor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xor(true, false) == true Xor(true, true) == false Xor4(true, true, true, false) == true Xor4(true, true, true, true) == false
Example ¶
fmt.Println(Xor(true, false)) // true fmt.Println(Xor(true, true)) // false fmt.Println(Xor4(true, true, true, false)) // true fmt.Println(Xor4(true, true, true, true)) // false
Output: true false true false
func Xor0 ¶ added in v0.1.0
func Xor0() bool
Checks if odd no. of values are true.
// Xor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xor(true, false) == true Xor(true, true) == false Xor4(true, true, true, false) == true Xor4(true, true, true, true) == false
func Xor1 ¶ added in v0.1.0
Checks if odd no. of values are true.
// Xor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xor(true, false) == true Xor(true, true) == false Xor4(true, true, true, false) == true Xor4(true, true, true, true) == false
func Xor2 ¶ added in v0.1.0
Checks if odd no. of values are true.
// Xor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xor(true, false) == true Xor(true, true) == false Xor4(true, true, true, false) == true Xor4(true, true, true, true) == false
func Xor3 ¶ added in v0.1.0
Checks if odd no. of values are true.
// Xor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xor(true, false) == true Xor(true, true) == false Xor4(true, true, true, false) == true Xor4(true, true, true, true) == false
func Xor4 ¶ added in v0.1.0
Checks if odd no. of values are true.
// Xor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xor(true, false) == true Xor(true, true) == false Xor4(true, true, true, false) == true Xor4(true, true, true, true) == false
func Xor5 ¶ added in v0.1.0
Checks if odd no. of values are true.
// Xor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xor(true, false) == true Xor(true, true) == false Xor4(true, true, true, false) == true Xor4(true, true, true, true) == false
func Xor6 ¶ added in v0.1.0
Checks if odd no. of values are true.
// Xor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xor(true, false) == true Xor(true, true) == false Xor4(true, true, true, false) == true Xor4(true, true, true, true) == false
func Xor7 ¶ added in v0.1.0
Checks if odd no. of values are true.
// Xor[n](a, b, ...) // a: 1st boolean // b: 2nd boolean
Example:
Xor(true, false) == true Xor(true, true) == false Xor4(true, true, true, false) == true Xor4(true, true, true, true) == false
Types ¶
This section is empty.