Exception: Flt::Num::DivisionByZero
- Defined in:
- lib/flt/num.rb
Overview
Division by zero exception.
The result of the operation is +/-Infinity, where the sign is the product of the signs of the operands for divide, or 1 for an odd power of -0.
Instance Attribute Summary
Attributes inherited from Exception
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context = nil, sign = nil, *args) ⇒ DivisionByZero
constructor
A new instance of DivisionByZero.
Constructor Details
#initialize(context = nil, sign = nil, *args) ⇒ DivisionByZero
Returns a new instance of DivisionByZero.
238 239 240 241 |
# File 'lib/flt/num.rb', line 238 def initialize(context=nil, sign=nil, *args) @sign = sign super context end |
Class Method Details
.handle(context, sign, *args) ⇒ Object
235 236 237 |
# File 'lib/flt/num.rb', line 235 def self.handle(context,sign,*args) context.num_class.infinity(sign) end |