Back to index

python3.2  3.2.2
Public Member Functions
decimal.Overflow Class Reference
Inheritance diagram for decimal.Overflow:
Inheritance graph
[legend]
Collaboration diagram for decimal.Overflow:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def handle
def handle
def handle

Detailed Description

Numerical overflow.

This occurs and signals overflow if the adjusted exponent of a result
(from a conversion or from an operation that is not an attempt to divide
by zero), after rounding, would be greater than the largest value that
can be handled by the implementation (the value Emax).

The result depends on the rounding mode:

For round-half-up and round-half-even (and for round-half-down and
round-up, if implemented), the result of the operation is [sign,inf],
where sign is the sign of the intermediate result.  For round-down, the
result is the largest finite number that can be represented in the
current precision, with the sign of the intermediate result.  For
round-ceiling, the result is the same as for round-down if the sign of
the intermediate result is 1, or is [0,inf] otherwise.  For round-floor,
the result is the same as for round-down if the sign of the intermediate
result is 0, or is [1,inf] otherwise.  In all cases, Inexact and Rounded
will also be raised.

Definition at line 320 of file decimal.py.


Member Function Documentation

def decimal.DecimalException.handle (   self,
  context,
  args 
) [inherited]

Reimplemented in decimal.InvalidContext, decimal.DivisionUndefined, decimal.DivisionImpossible, decimal.ConversionSyntax, and decimal.InvalidOperation.

Definition at line 178 of file decimal.py.

00178 
00179     def handle(self, context, *args):
00180         pass
00181 

Here is the caller graph for this function:

def decimal.DecimalException.handle (   self,
  context,
  args 
) [inherited]

Reimplemented in decimal.InvalidContext, decimal.DivisionUndefined, decimal.DivisionImpossible, decimal.ConversionSyntax, and decimal.InvalidOperation.

Definition at line 178 of file decimal.py.

00178 
00179     def handle(self, context, *args):
00180         pass
00181 

Here is the caller graph for this function:

def decimal.Overflow.handle (   self,
  context,
  sign,
  args 
)

Definition at line 342 of file decimal.py.

00342 
00343     def handle(self, context, sign, *args):
00344         if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN,
00345                                 ROUND_HALF_DOWN, ROUND_UP):
00346             return _SignedInfinity[sign]
00347         if sign == 0:
00348             if context.rounding == ROUND_CEILING:
00349                 return _SignedInfinity[sign]
00350             return _dec_from_triple(sign, '9'*context.prec,
00351                             context.Emax-context.prec+1)
00352         if sign == 1:
00353             if context.rounding == ROUND_FLOOR:
00354                 return _SignedInfinity[sign]
00355             return _dec_from_triple(sign, '9'*context.prec,
00356                              context.Emax-context.prec+1)
00357 

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: