diff options
author | Mark Wiebe <mwwiebe@gmail.com> | 2010-12-02 23:20:47 -0800 |
---|---|---|
committer | Mark Wiebe <mwwiebe@gmail.com> | 2010-12-03 11:25:36 -0800 |
commit | 7e18eafe4480246062b3c40e3df1e90ee268181d (patch) | |
tree | 68bb5ecdf83ff5cecfccbbdde6c5793f13f01422 /numpy/core/src/scalarmathmodule.c.src | |
parent | e2e265248d2a1f7f71d28e3d6ebebeb8eb597c71 (diff) | |
download | numpy-7e18eafe4480246062b3c40e3df1e90ee268181d.tar.gz |
BUG: core: Some fixes and clean up of floating point exception code
Diffstat (limited to 'numpy/core/src/scalarmathmodule.c.src')
-rw-r--r-- | numpy/core/src/scalarmathmodule.c.src | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index 712932958..d1a66e101 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -145,7 +145,7 @@ static void if ((*out^a) >= 0 || (*out^b) >= 0) { return; } - generate_overflow_error(); + npy_set_floatstatus_overflow(); return; } static void @@ -154,7 +154,7 @@ static void if ((*out^a) >= 0 || (*out^~b) >= 0) { return; } - generate_overflow_error(); + npy_set_floatstatus_overflow(); return; } /**end repeat**/ @@ -168,7 +168,7 @@ static void if (*out >= a && *out >= b) { return; } - generate_overflow_error(); + npy_set_floatstatus_overflow(); return; } static void @@ -177,7 +177,7 @@ static void if (a >= b) { return; } - generate_overflow_error(); + npy_set_floatstatus_overflow(); return; } /**end repeat**/ @@ -206,7 +206,7 @@ static void #else if (temp > MAX_@NAME@) #endif - generate_overflow_error(); + npy_set_floatstatus_overflow(); return; } #endif @@ -223,7 +223,7 @@ static void @name@_ctype_multiply(@name@ a, @name@ b, @name@ *out) { *out = a * b; if (@char@longlong_overflow(a, b)) { - generate_overflow_error(); + npy_set_floatstatus_overflow(); } return; } @@ -239,12 +239,12 @@ static void static void @name@_ctype_divide(@name@ a, @name@ b, @name@ *out) { if (b == 0) { - generate_divbyzero_error(); + npy_set_floatstatus_divbyzero(); *out = 0; } #if @neg@ else if (b == -1 && a < 0 && a == -a) { - generate_overflow_error(); + npy_set_floatstatus_overflow(); *out = a / b; } #endif @@ -266,7 +266,7 @@ static void static void @name@_ctype_remainder(@name@ a, @name@ b, @name@ *out) { if (a == 0 || b == 0) { - if (b == 0) generate_divbyzero_error(); + if (b == 0) npy_set_floatstatus_divbyzero(); *out = 0; return; } @@ -450,7 +450,7 @@ static void @name@_ctype_negative(npy_@name@ a, npy_@name@ *out) { #if @uns@ - generate_overflow_error(); + npy_set_floatstatus_overflow(); #endif *out = -a; } |