Class: Flt::PermilleTolerance

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

Overview

Implementation of permille (relative) tolerances

Instance Method Summary collapse

Methods inherited from RelativeTolerance

#relative_to

Methods inherited from Tolerance

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

Constructor Details

#initialize(value) ⇒ PermilleTolerance

Returns a new instance of PermilleTolerance.



303
304
305
# File 'lib/flt/tolerance.rb', line 303

def initialize(value)
  super
end

Instance Method Details

#cast_value(num_class) ⇒ Object



309
310
311
# File 'lib/flt/tolerance.rb', line 309

def cast_value(num_class)
  num_class.Num(@value)/num_class.Num(1000)
end

#to_sObject



306
307
308
# File 'lib/flt/tolerance.rb', line 306

def to_s
  "#{descr_value}/1000"
end