20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
*/
#else
#include <cmath>
#define cast_to_double static_cast<double>
using std::pow;
#endif /* ! __cplusplus */
static double pi = M_PI;
static double Pi = M_PI;
static double PI = M_PI;
static inline double
max (const double x1, const double x2)
{
return cast_to_double ((x1 >= x2) ? x1 : (x1 < x2) ? x2 : 0);
}
|
|
|
>
>
>
>
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
*/
#else
#include <cmath>
#define cast_to_double static_cast<double>
using std::pow;
#endif /* ! __cplusplus */
#ifdef M_PI
static double pi = M_PI;
static double Pi = M_PI;
static double PI = M_PI;
#else
static double pi = 3.1416;
static double Pi = pi;
static double PI = pi;
#endif
static inline double
max (const double x1, const double x2)
{
return cast_to_double ((x1 >= x2) ? x1 : (x1 < x2) ? x2 : 0);
}
|