Module: Trith::Core::Numeric::Constructors

Defined in:
lib/trith/core/numeric.rb

Overview

Numeric constructors.

Instance Method Summary (collapse)

Instance Method Details

- (Numeric) inf

Returns:



111
112
113
# File 'lib/trith/core/numeric.rb', line 111

def inf
  Constants::INF
end

- (Numeric) num(obj)

Parameters:

  • (Object) obj

Returns:



102
103
104
105
106
107
# File 'lib/trith/core/numeric.rb', line 102

def num(obj)
  case obj
    when Numeric then obj
    else obj.to_i # FIXME
  end
end