Class: Math::SetTheory::RealNumbers

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

Overview

includes all the measuring-numbers

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

#initializeRealNumbers

Returns a new instance of RealNumbers.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ruuuby/math/set_theory/discrete/real_numbers.rb', line 11

def initialize
  super(:ℝ, ::Math::SetTheory::NumberSet::AlephNumbers::ONE, {
      closed_under_addition: true,
      closed_under_multiplication: true,
      closed_under_subtraction: true,
      closed_under_division: true,
      dense: true,
      continuous: true
  })
  @subset_of   = [:π•Œ, :β„‚]
  @superset_of = [:𝔹, :β„•, :π•Ž, :β„€, :𝔸ᡣ, :𝔸, :β„š, :𝕀]
end

Instance Method Details

#_βˆ‹?(n) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
28
29
30
31
32
33
# File 'lib/ruuuby/math/set_theory/discrete/real_numbers.rb', line 25

def _βˆ‹?(n)
  case(n)
  when ::Integer;           true
  when ::Float, BigDecimal; n.to_f.finite?
  when ::Complex;           n.imaginary == 0 && ℝ.βˆ‹?(n.real)
  when ::Rational;          ℝ.βˆ‹?(n.numerator) && ℝ.βˆ‹?(n.denominator)
  else;                   false
  end
end