Exception: Flt::Num::DivisionByZero

Inherits:
Exception show all
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

#context

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context = nil, sign = nil, *args) ⇒ DivisionByZero

Returns a new instance of DivisionByZero.



239
240
241
242
# File 'lib/flt/num.rb', line 239

def initialize(context=nil, sign=nil, *args)
  @sign = sign
  super context
end

Class Method Details

.handle(context, sign, *args) ⇒ Object



236
237
238
# File 'lib/flt/num.rb', line 236

def self.handle(context,sign,*args)
  context.num_class.infinity(sign)
end