Boolean

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 1 Imported by: 0

README

Boolean data type has two possible truth values to represent logic.

Documentation

Overview

Boolean data type has two possible truth values to represent logic.

📦 Package: https://package.elm-lang.org/packages/elmw/extra-boolean/latest/ 📘 Wiki: https://github.com/elmw/extra-boolean/wiki.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func And added in v0.1.0

func And(a bool, b bool) 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 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

func And1(a bool) 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 And2 added in v0.1.0

func And2(a bool, b bool) 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 And3 added in v0.1.0

func And3(a bool, b bool, c bool) 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 And4 added in v0.1.0

func And4(a bool, b bool, c bool, d bool) 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 And5 added in v0.1.0

func And5(a bool, b bool, c bool, d bool, e bool) 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 And6 added in v0.1.0

func And6(a bool, b bool, c bool, d bool, e bool, f bool) 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 And7 added in v0.1.0

func And7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) 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 And8 added in v0.1.0

func And8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) 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 Count added in v0.1.0

func Count(a bool, b bool) 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 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

func Count1(a bool) 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 Count2 added in v0.1.0

func Count2(a bool, b bool) 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 Count3 added in v0.1.0

func Count3(a bool, b bool, c bool) 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 Count4 added in v0.1.0

func Count4(a bool, b bool, c bool, d bool) 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 Count5 added in v0.1.0

func Count5(a bool, b bool, c bool, d bool, e bool) 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 Count6 added in v0.1.0

func Count6(a bool, b bool, c bool, d bool, e bool, f bool) 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 Count7 added in v0.1.0

func Count7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) 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 Count8 added in v0.1.0

func Count8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) 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 Eq added in v0.0.3

func Eq(a bool, b bool) bool

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

func Eqv added in v0.1.0

func Eqv(a bool, b bool) bool

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

func Imp added in v0.1.0

func Imp(a bool, b bool) bool

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

func Imply added in v0.0.3

func Imply(a bool, b bool) bool

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

func Nand added in v0.1.0

func Nand(a bool, b bool) 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 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

func Nand1(a bool) 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 Nand2 added in v0.1.0

func Nand2(a bool, b bool) 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 Nand3 added in v0.1.0

func Nand3(a bool, b bool, c bool) 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 Nand4 added in v0.1.0

func Nand4(a bool, b bool, c bool, d bool) 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 Nand5 added in v0.1.0

func Nand5(a bool, b bool, c bool, d bool, e bool) 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 Nand6 added in v0.1.0

func Nand6(a bool, b bool, c bool, d bool, e bool, f bool) 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 Nand7 added in v0.1.0

func Nand7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) 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 Nand8 added in v0.1.0

func Nand8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) 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 Neq added in v0.0.3

func Neq(a bool, b bool) bool

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

func Nimply added in v0.0.3

func Nimply(a bool, b bool) bool

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

func Nor added in v0.1.0

func Nor(a bool, b bool) 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 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

func Nor1(a bool) 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 Nor2 added in v0.1.0

func Nor2(a bool, b bool) 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 Nor3 added in v0.1.0

func Nor3(a bool, b bool, c bool) 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 Nor4 added in v0.1.0

func Nor4(a bool, b bool, c bool, d bool) 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 Nor5 added in v0.1.0

func Nor5(a bool, b bool, c bool, d bool, e bool) 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 Nor6 added in v0.1.0

func Nor6(a bool, b bool, c bool, d bool, e bool, f bool) 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 Nor7 added in v0.1.0

func Nor7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) 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 Nor8 added in v0.1.0

func Nor8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) 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 Not added in v0.0.3

func Not(a bool) bool

Checks if value is false.

// Not(a, b)
// a: a boolean

Example:

Not(false) == true
Not(true)  == false

func Or added in v0.1.0

func Or(a bool, b bool) 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 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

func Or1(a bool) 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 Or2 added in v0.1.0

func Or2(a bool, b bool) 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 Or3 added in v0.1.0

func Or3(a bool, b bool, c bool) 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 Or4 added in v0.1.0

func Or4(a bool, b bool, c bool, d bool) 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 Or5 added in v0.1.0

func Or5(a bool, b bool, c bool, d bool, e bool) 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 Or6 added in v0.1.0

func Or6(a bool, b bool, c bool, d bool, e bool, f bool) 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 Or7 added in v0.1.0

func Or7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) 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 Or8 added in v0.1.0

func Or8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) 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 Parse added in v0.0.1

func Parse(s string) bool

Converts string to boolean.

// Parse(s)
// s: a string

Example:

Parse("1")        == true
Parse("truthy")   == true
Parse("not off")  == true
Parse("not true") == false
Parse("inactive") == false
Parse("disabled") == false
Example (False1)
fmt.Println(Parse("not true"))
Output:

false
Example (False2)
fmt.Println(Parse("inactive"))
Output:

false
Example (False3)
fmt.Println(Parse("disabled"))
Output:

false
Example (True1)
fmt.Println(Parse("1"))
Output:

true
Example (True2)
fmt.Println(Parse("truthy"))
Output:

true
Example (True3)
fmt.Println(Parse("not off"))
Output:

true

func Select added in v0.1.0

func Select(i int, a bool, b bool) bool

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 Select0 added in v0.1.0

func Select0(i int) bool

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

func Select1(i int, a bool) bool

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

func Select2(i int, a bool, b bool) bool

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

func Select3(i int, a bool, b bool, c bool) bool

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

func Select4(i int, a bool, b bool, c bool, d bool) bool

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

func Select5(i int, a bool, b bool, c bool, d bool, e bool) bool

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

func Select6(i int, a bool, b bool, c bool, d bool, e bool, f bool) bool

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

func Select7(i int, a bool, b bool, c bool, d bool, e bool, f bool, g bool) bool

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

func Select8(i int, a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) bool

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

func Xnor(a bool, b bool) 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 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

func Xnor1(a bool) 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 Xnor2 added in v0.1.0

func Xnor2(a bool, b bool) 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 Xnor3 added in v0.1.0

func Xnor3(a bool, b bool, c bool) 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 Xnor4 added in v0.1.0

func Xnor4(a bool, b bool, c bool, d bool) 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 Xnor5 added in v0.1.0

func Xnor5(a bool, b bool, c bool, d bool, e bool) 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 Xnor6 added in v0.1.0

func Xnor6(a bool, b bool, c bool, d bool, e bool, f bool) 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 Xnor7 added in v0.1.0

func Xnor7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) 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 Xnor8 added in v0.1.0

func Xnor8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) 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 Xor added in v0.1.0

func Xor(a bool, b bool) 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 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

func Xor1(a bool) 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 Xor2 added in v0.1.0

func Xor2(a bool, b bool) 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 Xor3 added in v0.1.0

func Xor3(a bool, b bool, c bool) 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 Xor4 added in v0.1.0

func Xor4(a bool, b bool, c bool, d bool) 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 Xor5 added in v0.1.0

func Xor5(a bool, b bool, c bool, d bool, e bool) 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 Xor6 added in v0.1.0

func Xor6(a bool, b bool, c bool, d bool, e bool, f bool) 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 Xor7 added in v0.1.0

func Xor7(a bool, b bool, c bool, d bool, e bool, f bool, g bool) 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 Xor8 added in v0.1.0

func Xor8(a bool, b bool, c bool, d bool, e bool, f bool, g bool, h bool) 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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL