summaryrefslogtreecommitdiff
path: root/src/mpc.h
diff options
context:
space:
mode:
authorenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2011-01-07 18:57:05 +0000
committerenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2011-01-07 18:57:05 +0000
commit33785e1f8a2cb7668fbf747ef85c4bbb4c4fc852 (patch)
tree4bceed00193e60190dbcbdba49f965294220cfaf /src/mpc.h
parentf1a9107dda88b31be61bc869b3f3dfb8a8e667d4 (diff)
downloadmpc-33785e1f8a2cb7668fbf747ef85c4bbb4c4fc852.tar.gz
mpc.h, mpc.texi:
defined and documented return value for functions computing two results It is obtained from the macro MPC_INEX12 (inex1, inex2) and decomposed again as MPC_INEX1 (inex) and MPC_INEX2 (inex) sin_cos.c, sin.c, cos.c: First steps to moving the computation of sin and cos into sin_cos: If one of rop_cos or rop_sin in sin_cos is NULL, then it is not computed. So far, implemented for special, real and purely imaginary values. git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@857 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src/mpc.h')
-rw-r--r--src/mpc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mpc.h b/src/mpc.h
index 15a72e1..db6463e 100644
--- a/src/mpc.h
+++ b/src/mpc.h
@@ -63,7 +63,7 @@ MA 02111-1307, USA. */
/* Transform 2 to negative, 1 to positive, leave 0 unchanged */
#define MPC_INEX_NEG(inex) (((inex) == 2) ? -1 : ((inex) == 0) ? 0 : 1)
-/* the global inexact flag is made of (real flag) + 4 * (imaginary flag), where
+/* The global inexact flag is made of (real flag) + 4 * (imaginary flag), where
each of the real and imaginary inexact flag are:
0 when the result is exact (no rounding error)
1 when the result is larger than the exact value
@@ -73,6 +73,12 @@ MA 02111-1307, USA. */
#define MPC_INEX_RE(inex) MPC_INEX_NEG((inex) & 3)
#define MPC_INEX_IM(inex) MPC_INEX_NEG((inex) >> 2)
+/* For functions computing two results, the return value is
+ inexact1+16*inexact2, which is 0 iif both results are exact. */
+#define MPC_INEX12(inex1, inex2) (inex1 | (inex2 << 4))
+#define MPC_INEX1(inex) (inex & 15)
+#define MPC_INEX2(inex) (inex >> 4)
+
/* Definition of rounding modes */
/* a complex rounding mode is just a pair of two real rounding modes