changeset 65:1feceb2a86f9

[project @ 1993-08-16 19:30:09 by jwe] (arg (double)): Return pi for negative real values.
author jwe
date Mon, 16 Aug 1993 19:30:09 +0000
parents bd04d91a7a4a
children 74d6f5fe70a1
files src/mappers.cc
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/mappers.cc	Sun Aug 15 05:08:48 1993 +0000
+++ b/src/mappers.cc	Mon Aug 16 19:30:09 1993 +0000
@@ -35,6 +35,14 @@
 #define finite(x) ((x) < DBL_MAX && (x) > -DBL_MAX)
 #endif
 
+#ifndef M_LOG10E
+#define M_LOG10E 0.43429448190325182765
+#endif
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
 /*
  * Double -> double mappers.
  */
@@ -42,7 +50,10 @@
 double
 arg (double x)
 {
-  return 0.0;
+  if (x < 0.0)
+    return M_PI;
+  else
+    return 0.0;
 }
 
 double
@@ -226,10 +237,6 @@
   return Complex (re, im);
 }
 
-#ifndef M_LOG10E
-#define M_LOG10E 0.43429448190325182765
-#endif
-
 Complex
 log10 (const Complex& x)
 {