Class: Numeric

Inherits:
Object show all
Includes:
MathViz::Measurable
Defined in:
lib/mathviz.rb

Instance Method Summary collapse

Methods included from MathViz::Measurable

#per, #unit

Methods included from MathViz::Units::Class

#included, #new_units

Instance Method Details

#finite?Boolean

Dummy defintion for all numerics. Normally only defined on things where it can possible return false.

Returns:

  • (Boolean)


231
232
233
# File 'lib/mathviz.rb', line 231

def finite?
  true
end

#max(b) ⇒ Object

Provide in operator form



221
222
223
# File 'lib/mathviz.rb', line 221

def max(b)
  [self, b].max
end

#min(b) ⇒ Object

Provide in operator form



226
227
228
# File 'lib/mathviz.rb', line 226

def min(b)
  [self, b].min
end