Class: Math::SetTheory::BooleanNumbers

Inherits:
NumberSet show all
Includes:
Singleton
Defined in:
lib/ruuuby/math/set_theory/discrete/boolean_numbers.rb

Instance Attribute Summary

Attributes inherited from NumberSet

#name, #symbol, #𝔠

Attributes inherited from Closure

#axioms

Instance Method Summary collapse

Methods inherited from NumberSet

#countable?, #countably_infinite?, #finite?, #uncountable?, #βˆ‹?, #∌?, #βŠ‚?, #βŠƒ?, #βŠ„?, #βŠ…?, #βŠ†?, #βŠ‡?

Constructor Details

#initializeBooleanNumbers

Returns a new instance of BooleanNumbers.



10
11
12
13
# File 'lib/ruuuby/math/set_theory/discrete/boolean_numbers.rb', line 10

def initialize
  super(:𝔹, 2)
  @subset_of = [:π•Œ, :𝔸ᡣ, :𝔸, :ℝ, :β„‚, :β„š, :β„€, :π•Ž]
end

Instance Method Details

#_βˆ‹?(n) ⇒ Boolean

Returns true, if this number is equivalent to 0 or 1 (all numbers in the boolean-domain+𝔹+).

Parameters:

Returns:

  • (Boolean)

    true, if this number is equivalent to 0 or 1 (all numbers in the boolean-domain+𝔹+)



18
# File 'lib/ruuuby/math/set_theory/discrete/boolean_numbers.rb', line 18

def _βˆ‹?(n); n.zero? || n.one?; end