Lines Matching defs:phi
1013 double phi;
1016 phi = c_atan2(z);
1020 return PyFloat_FromDouble(phi);
1031 r is the distance from 0 and phi the phase angle.
1038 double r, phi;
1041 phi = c_atan2(z); /* should not cause any exception */
1046 return Py_BuildValue("dd", r, phi);
1066 phi: double
1073 cmath_rect_impl(PyObject *module, double r, double phi)
1080 if (!Py_IS_FINITE(r) || !Py_IS_FINITE(phi)) {
1081 /* if r is +/-infinity and phi is finite but nonzero then
1082 result is (+-INF +-INF i), but we need to compute cos(phi)
1083 and sin(phi) to figure out the signs. */
1084 if (Py_IS_INFINITY(r) && (Py_IS_FINITE(phi)
1085 && (phi != 0.))) {
1087 z.real = copysign(INF, cos(phi));
1088 z.imag = copysign(INF, sin(phi));
1091 z.real = -copysign(INF, cos(phi));
1092 z.imag = -copysign(INF, sin(phi));
1097 [special_type(phi)];
1099 /* need to set errno = EDOM if r is a nonzero number and phi
1101 if (r != 0. && !Py_IS_NAN(r) && Py_IS_INFINITY(phi))
1106 else if (phi == 0.0) {
1107 /* Workaround for buggy results with phi=-0.0 on OS X 10.8. See
1110 z.imag = r * phi;
1114 z.real = r * cos(phi);
1115 z.imag = r * sin(phi);