Back to index

python3.2  3.2.2
Defines | Functions
pymath.h File Reference
#include "pyconfig.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define Py_MATH_PIl   3.1415926535897932384626433832795029L
#define Py_MATH_PI   3.14159265358979323846
#define Py_MATH_El   2.7182818284590452353602874713526625L
#define Py_MATH_E   2.7182818284590452354
#define Py_FORCE_DOUBLE(X)   (X)
#define Py_IS_NAN(X)   ((X) != (X))
#define Py_IS_INFINITY(X)
#define Py_IS_FINITE(X)   (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))
#define Py_HUGE_VAL   HUGE_VAL
#define Py_NAN   (Py_HUGE_VAL * 0.)
#define Py_OVERFLOWED(X)

Functions

double copysign (double, double)
double round (double)
double hypot (double, double)
double fmod (double, double)
double frexp (double, int *)
double ldexp (double, int)
double modf (double, double *)
double pow (double, double)

Define Documentation

#define Py_FORCE_DOUBLE (   X)    (X)

Definition at line 76 of file pymath.h.

#define Py_HUGE_VAL   HUGE_VAL

Definition at line 150 of file pymath.h.

#define Py_IS_FINITE (   X)    (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))

Definition at line 138 of file pymath.h.

#define Py_IS_INFINITY (   X)
Value:
((X) &&                                   \
                               (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X)))

Definition at line 121 of file pymath.h.

#define Py_IS_NAN (   X)    ((X) != (X))

Definition at line 101 of file pymath.h.

#define Py_MATH_E   2.7182818284590452354

Definition at line 61 of file pymath.h.

#define Py_MATH_El   2.7182818284590452353602874713526625L

Definition at line 57 of file pymath.h.

#define Py_MATH_PI   3.14159265358979323846

Definition at line 53 of file pymath.h.

#define Py_MATH_PIl   3.1415926535897932384626433832795029L

Definition at line 50 of file pymath.h.

#define Py_NAN   (Py_HUGE_VAL * 0.)

Definition at line 159 of file pymath.h.

#define Py_OVERFLOWED (   X)
Value:
((X) != 0.0 && (errno == ERANGE ||    \
                                    (X) == Py_HUGE_VAL || \
                                    (X) == -Py_HUGE_VAL))

Definition at line 191 of file pymath.h.


Function Documentation

double copysign ( double  ,
double   
)

Definition at line 57 of file pymath.c.

{
    /* use atan2 to distinguish -0. from 0. */
    if (y > 0. || (y == 0. && atan2(y, -1.) > 0.)) {
        return fabs(x);
    } else {
        return -fabs(x);
    }
}

Here is the caller graph for this function:

double fmod ( double  ,
double   
)

Here is the caller graph for this function:

double frexp ( double  ,
int  
)

Here is the caller graph for this function:

double hypot ( double  ,
double   
)

Definition at line 35 of file pymath.c.

{
    double yx;

    x = fabs(x);
    y = fabs(y);
    if (x < y) {
        double temp = x;
        x = y;
        y = temp;
    }
    if (x == 0.)
        return 0.;
    else {
        yx = y/x;
        return x*sqrt(1.+yx*yx);
    }
}

Here is the caller graph for this function:

double ldexp ( double  ,
int   
)

Here is the caller graph for this function:

double modf ( double  ,
double *   
)

Here is the caller graph for this function:

double pow ( double  ,
double   
)

Here is the caller graph for this function:

double round ( double  )

Definition at line 70 of file pymath.c.

{
    double absx, y;
    absx = fabs(x);
    y = floor(absx);
    if (absx - y >= 0.5)
    y += 1.0;
    return copysign(y, x);
}

Here is the call graph for this function:

Here is the caller graph for this function: