Exception: Flt::Num::Inexact

Inherits:
Exception show all
Defined in:
lib/flt/num.rb

Overview

Inexact Exception.

This occurs and signals inexact whenever the result of an operation is not exact (that is, it needed to be rounded and any discarded digits were non-zero), or if an overflow or underflow condition occurs. The result in all cases is unchanged unless the context has exact precision, in which case the result is Nan

Instance Attribute Summary

Attributes inherited from Exception

#context

Class Method Summary collapse

Methods inherited from Exception

#initialize

Constructor Details

This class inherits a constructor from Flt::Num::Exception

Class Method Details

.handle(context, *args) ⇒ Object



277
278
279
# File 'lib/flt/num.rb', line 277

def self.handle(context, *args)
  context.num_class.nan if context.exact?
end