Included Modules

Class Index [+]



Public Class Methods

float_correctly_rounded?() click to toggle source

Is Float(’…’) correctly rounded, even for subnormal numbers?

     # File lib/flt/float.rb, line 488
488: def Flt.float_correctly_rounded?
489:   # That doesn't seem to be the case for mswin32
490:   @float_correctly_rounded ||= RUBY_PLATFORM.match(/mswin32/).nil?
491: end

Public Instance Methods

BinNum(*args) click to toggle source
     # File lib/flt/bin_num.rb, line 249
249: def BinNum(*args)
250:   BinNum.Num(*args)
251: end
ComplexContext(context) click to toggle source
     # File lib/flt/complex.rb, line 294
294:   def ComplexContext(context)
296:   end
DecNum(*args) click to toggle source

DecNum constructor. See DecNum#new for the parameters. If a DecNum is passed a reference to it is returned (no new object is created).

      # File lib/flt/dec_num.rb, line 1215
1215: def DecNum(*args)
1216:   DecNum.Num(*args)
1217: end
Tolerance(*args) click to toggle source

Tolerance constructor.

The first parameter is the value (magnitude) of the tolerance, and is optional for some tolerances.

The next parameter is the kind of tolerance as a symbol. It corresponds to the name of the implementation class minus the Tolerance suffix, and converted to snake-case (lowercase with underscores to separate words.)

Finally any additional parameters admitted by the class constructor can be passed.

     # File lib/flt/tolerance.rb, line 551
551:   def Tolerance(*args)
552:     if args.first.is_a?(Symbol)
553:       value = nil
554:     else
555:       value = args.shift
556:     end
557:     cls_name = (args.shift || :absolute).to_s.gsub(/(^|_)(.)/){$2.upcase} + "Tolerance"
558:     Flt.const_get(cls_name).new(value, *args)
559:   end

Disabled; run with --debug to generate this.


Generated with the Darkfish Rdoc Generator 1.1.6.