Mercurial > octave-nkf
comparison src/mappers.cc @ 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 | 78fd87e624cb |
children | e2c950dd96d2 |
comparison
equal
deleted
inserted
replaced
64:bd04d91a7a4a | 65:1feceb2a86f9 |
---|---|
33 #if defined (_AIX) && defined (__GNUG__) | 33 #if defined (_AIX) && defined (__GNUG__) |
34 #undef finite | 34 #undef finite |
35 #define finite(x) ((x) < DBL_MAX && (x) > -DBL_MAX) | 35 #define finite(x) ((x) < DBL_MAX && (x) > -DBL_MAX) |
36 #endif | 36 #endif |
37 | 37 |
38 #ifndef M_LOG10E | |
39 #define M_LOG10E 0.43429448190325182765 | |
40 #endif | |
41 | |
42 #ifndef M_PI | |
43 #define M_PI 3.14159265358979323846 | |
44 #endif | |
45 | |
38 /* | 46 /* |
39 * Double -> double mappers. | 47 * Double -> double mappers. |
40 */ | 48 */ |
41 | 49 |
42 double | 50 double |
43 arg (double x) | 51 arg (double x) |
44 { | 52 { |
45 return 0.0; | 53 if (x < 0.0) |
54 return M_PI; | |
55 else | |
56 return 0.0; | |
46 } | 57 } |
47 | 58 |
48 double | 59 double |
49 conj (double x) | 60 conj (double x) |
50 { | 61 { |
224 int re = (int) floor (real (x)); | 235 int re = (int) floor (real (x)); |
225 int im = (int) floor (imag (x)); | 236 int im = (int) floor (imag (x)); |
226 return Complex (re, im); | 237 return Complex (re, im); |
227 } | 238 } |
228 | 239 |
229 #ifndef M_LOG10E | |
230 #define M_LOG10E 0.43429448190325182765 | |
231 #endif | |
232 | |
233 Complex | 240 Complex |
234 log10 (const Complex& x) | 241 log10 (const Complex& x) |
235 { | 242 { |
236 return M_LOG10E * log (x); | 243 return M_LOG10E * log (x); |
237 } | 244 } |