.:
apps __init__.py lib mptypes.py tests
(711 lines of code)
./apps:
extrafun.py __init__.py interval.py pidigits.py quad.py taylordemo.py
(963 lines of code)
./lib:
complexop.py constants.py floatop.py functions.py __init__.py
numerals.py squareroot.py util.py
(1751 lines of code)
./tests:
benchmark.py test_bitwise.py test_convert.py
test_functions2.py test_interval.py test_power.py test_special.py
runtests.py test_compatibility.py test_division.py test_hp.py
test_mpmath.py test_quad.py
>
> > *ERROR* floatop:282: no such class: 'OverflowError'
>
> I haven't had the time to figure out how to properly support
> OverflowError and ZeroDivisionError.. if anyone is interested.. ^^
>
> > Any ideas on how I could work around this?
>
> just for testing purposes, you can add OverflowError to
> lib/builtin.py, so you can at least generate C++ code.
>
>
> mark.
> --
> "One of my most productive days was throwing away 1000 lines of code"
> - Ken Thompson
>
-jeff
p.s. I've cc'd the new google group too.
I had a look at supporting OverflowError and ZeroDivisionError, and
apparently C++ has no provision for this.. I think the following might
work, then.. also in nested situations (the inner catch is found).
#include <signal.h>
#include <setjmp.h>
jmp_buf context;
void problem(int sig) {
longjmp(context, sig);
}
int main() {
int a = 0;
int b = 20;
int c;
int i;
signal(SIGFPE, problem);
try {
if ((i=setjmp(context)) == 0)
{
while(1)
c = b/a;
}
else
throw i;
} catch (int) {
printf("exception.. %d\n", i);