Lines Matching defs:imag
32 r.imag = a.imag + b.imag;
41 r.imag = a.imag - b.imag;
50 r.imag = -a.imag;
58 r.real = a.real*b.real - a.imag*b.imag;
59 r.imag = a.real*b.imag + a.imag*b.real;
78 double d = b.real*b.real + b.imag*b.imag;
81 r.real = (a.real*b.real + a.imag*b.imag)/d;
82 r.imag = (a.imag*b.real - a.real*b.imag)/d;
87 * numerators and denominator by whichever of {b.real, b.imag} has
95 const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;
101 r.real = r.imag = 0.0;
104 const double ratio = b.imag / b.real;
105 const double denom = b.real + b.imag * ratio;
106 r.real = (a.real + a.imag * ratio) / denom;
107 r.imag = (a.imag - a.real * ratio) / denom;
111 /* divide tops and bottom by b.imag */
112 const double ratio = b.real / b.imag;
113 const double denom = b.real * ratio + b.imag;
114 assert(b.imag != 0.0);
115 r.real = (a.real * ratio + a.imag) / denom;
116 r.imag = (a.imag * ratio - a.real) / denom;
119 /* At least one of b.real or b.imag is a NaN */
120 r.real = r.imag = Py_NAN;
133 if (b.real == 0. && b.imag == 0.) {
135 r.imag = 0.;
137 else if (a.real == 0. && a.imag == 0.) {
138 if (b.imag != 0. || b.real < 0.)
141 r.imag = 0.;
144 vabs = hypot(a.real,a.imag);
146 at = atan2(a.imag, a.real);
148 if (b.imag != 0.0) {
149 len /= exp(at*b.imag);
150 phase += b.imag*log(vabs);
153 r.imag = len*sin(phase);
190 if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) {
199 if (Py_IS_INFINITY(z.imag)) {
200 result = fabs(z.imag);
208 result = hypot(z.real, z.imag);
241 complex_subtype_from_doubles(PyTypeObject *type, double real, double imag)
245 c.imag = imag;
250 PyComplex_FromDoubles(double real, double imag)
254 c.imag = imag;
273 return ((PyComplexObject *)op)->cval.imag;
328 cv.imag = 0.;
371 im = PyOS_double_to_string(v->cval.imag, format_code,
388 im = PyOS_double_to_string(v->cval.imag, format_code,
412 hashimag = (Py_uhash_t)_Py_HashDouble((PyObject *)v, v->cval.imag);
439 pc->real = pc->imag = 0.0;
522 if (b.imag == 0.0 && b.real == floor(b.real) && fabs(b.real) <= 100.0) {
529 _Py_ADJUST_ERANGE2(p.real, p.imag);
548 neg.imag = -v->cval.imag;
581 return v->cval.real != 0.0 || v->cval.imag != 0.0;
602 if (i.imag == 0.0) {
617 equal = (i.real == PyFloat_AsDouble(w) && i.imag == 0.0);
623 equal = (i.real == j.real && i.imag == j.imag);
652 c.imag = -c.imag;
666 return Py_BuildValue("(dd)", c.real, c.imag);
728 {"imag", T_DOUBLE, offsetof(PyComplexObject, cval.imag), READONLY,
890 imag as i: object(c_default="NULL") = 0
894 This is equivalent to (real + imag*1j) where imag defaults to 0.
976 /* If we get this far, then the "real" and "imag" parts should
978 complex number equal to (real + imag*1j).
981 form; the "real" and "imag" parts might themselves be complex
985 retaining its real & imag parts here, and the return
1007 cr.imag = 0.0;
1011 ci.real = cr.imag;
1017 /* The "imag" part really is entirely imaginary, and
1026 /* If the input was in canonical form, then the "real" and "imag"
1027 parts are real numbers, so that ci.imag and cr.imag are zero.
1031 cr.real -= ci.imag;
1034 ci.real += cr.imag;