Class: Flt::AbsoluteTolerance

Inherits:
Tolerance show all
Defined in:
lib/flt/tolerance.rb

Overview

Implementation of absolute tolerances

Instance Method Summary collapse

Methods inherited from Tolerance

#[], big_epsilon, bits, #cast_value, decimals, define_sugar, #descr_value, digits, epsilon, #eq?, #equal_to?, #greater_than?, #gt?, #integer, #integer?, #less_than?, #lt?, #seq?, #to_s, #value, #zero?

Constructor Details

#initialize(value) ⇒ AbsoluteTolerance

Returns a new instance of AbsoluteTolerance.


260
261
262
# File 'lib/flt/tolerance.rb', line 260

def initialize(value)
  super
end

Instance Method Details

#relative_to(x) ⇒ Object


263
264
265
# File 'lib/flt/tolerance.rb', line 263

def relative_to(x)
  cast_value(x.class)
end

#relative_to_many(mode, *xs) ⇒ Object


266
267
268
# File 'lib/flt/tolerance.rb', line 266

def relative_to_many(mode, *xs)
  cast_value(xs.first.class)
end