Message104502
Mark,
I'm very short of time today, so I hope I don't miss anything that you
wrote.
The model of decNumber (and libmpdec) is to accumulate any status
(flags) that occurs in a function, regardless of whether a signal
is trapped or not.
Only at function exit the traps are checked. If multiple exceptions
could be raised, the order of precedence applies. All status that
has been accumulated in the function remains in the context.
This would be backed up by:
http://speleotrove.com/decimal/damodel.html
==> flags and trap-enablers:
==> "For each of the signals, the corresponding flag is set to 1
when the signal occurs. It is only reset to 0 by explicit
user action."
So, in your example, in cdecimal I get:
>>> from cdecimal import *
>>> getcontext().traps[Inexact] = True
>>> Decimal('1e100').exp()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cdecimal.Overflow: [<class 'cdecimal.Overflow'>, <class 'cdecimal.Inexact'>]
In the square brackets I list all signals that occurred _and_ are
trapped.
" |
|
Date |
User |
Action |
Args |
2010-04-29 13:23:52 | skrah | set | recipients:
+ skrah, rhettinger, facundobatista, mark.dickinson |
2010-04-29 13:23:51 | skrah | set | messageid: <1272547431.92.0.985648381868.issue8567@psf.upfronthosting.co.za> |
2010-04-29 13:23:50 | skrah | link | issue8567 messages |
2010-04-29 13:23:50 | skrah | create | |
|