Back to index

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

List of all members.

Public Member Functions

def handle

Detailed Description

An invalid operation was performed.

Various bad things cause this:

Something creates a signaling NaN
-INF + INF
0 * (+-)INF
(+-)INF / (+-)INF
x % 0
(+-)INF % x
x._rescale( non-integer )
sqrt(-x) , x > 0
0 ** 0
x ** (non-integer)
x ** (+-)INF
An operand is invalid

The result of the operation after these 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.

Definition at line 194 of file decimal.py.


Member Function Documentation

def decimal.InvalidOperation.handle (   self,
  context,
  args 
)

Reimplemented from decimal.DecimalException.

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

Definition at line 217 of file decimal.py.

00217 
00218     def handle(self, context, *args):
00219         if args:
00220             ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True)
00221             return ans._fix_nan(context)
00222         return _NaN

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: