Exception: Flt::Num::InvalidOperation
- Defined in:
- lib/flt/num.rb
Overview
Invalid operation exception.
The result of the operation is a quiet positive NaN, except when the cause is a signaling NaN, in which case the result is also a quiet NaN, but with the original sign, and an optional diagnostic information.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Exception
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context = nil, *args) ⇒ InvalidOperation
constructor
A new instance of InvalidOperation.
Constructor Details
#initialize(context = nil, *args) ⇒ InvalidOperation
Returns a new instance of InvalidOperation.
224 225 226 227 |
# File 'lib/flt/num.rb', line 224 def initialize(context=nil, *args) @value = args.first if args.size>0 super context end |
Class Method Details
.handle(context, *args) ⇒ Object
216 217 218 219 220 221 222 223 |
# File 'lib/flt/num.rb', line 216 def self.handle(context, *args) if args.size>0 sign, coeff, _exp = args.first.split context.num_class.new([sign, coeff, :nan])._fix_nan(context) else context.num_class.nan end end |