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.



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

def initialize(value)
  super
end

Instance Method Details

#relative_to(x) ⇒ Object



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

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

#relative_to_many(mode, *xs) ⇒ Object



270
271
272
# File 'lib/flt/tolerance.rb', line 270

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