Lines Matching refs:im

28         im = (optional) imaginary part of complex number, 0 if omitted.
33 $(D im) are floating-point numbers, the return type will
47 auto complex(R, I)(R re, I im) @safe pure nothrow @nogc
51 return Complex!(CommonType!(R, I))(re, im);
53 return Complex!double(re, im);
62 assert(a.im == 0.0);
67 assert(b.im == 0.0L);
72 assert(c.im == 2.0);
77 assert(d.im == 4.0L);
82 assert(e.im == 0);
87 assert(f.im == 2);
92 assert(g.im == 4.0L);
109 T im;
157 if (signbit(im) == 0)
159 formatValue(w, im, formatSpec);
173 im = z.im;
180 im = y;
187 im = 0;
196 im = z.im;
204 im = 0;
213 return re == z.re && im == z.im;
219 return re == r && im == 0;
235 return Complex(-re, -im);
244 auto w = C(this.re, this.im);
253 auto w = C(this.re, this.im);
268 return Complex(r - re, -im);
277 if (fabs(re) < fabs(im))
279 immutable ratio = re/im;
280 immutable rdivd = r/(re*ratio + im);
283 w.im = -rdivd;
287 immutable ratio = im/re;
288 immutable rdivd = r/(re + im*ratio);
291 w.im = -rdivd*ratio;
309 ar = log(lhs) * this.im;
315 ab = (-lhs) ^^ this.re * exp(-PI * this.im);
316 ar = PI * this.re + log(-lhs) * this.im;
329 mixin ("im "~op~"= z.im;");
337 auto temp = re*z.re - im*z.im;
338 im = im*z.re + re*z.im;
348 if (fabs(z.re) < fabs(z.im))
350 immutable ratio = z.re/z.im;
351 immutable denom = z.re*ratio + z.im;
353 immutable temp = (re*ratio + im)/denom;
354 im = (im*ratio - re)/denom;
359 immutable ratio = z.im/z.re;
360 immutable denom = z.re + z.im*ratio;
362 immutable temp = (re + im*ratio)/denom;
363 im = (im - re*ratio)/denom;
376 immutable ab = r^^z.re * exp(-t*z.im);
377 immutable ar = t*z.re + log(r)*z.im;
380 im = ab*sin(ar);
397 mixin ("im "~op~"= a;");
409 im = ab*sin(ar);
421 im = 0.0;
455 assert((-c2).im == -(c2.im));
461 assert(cpc.im == c1.im + c2.im);
465 assert(cmc.im == c1.im - c2.im);
477 assert(approxEqual(cec.im, 0.21870790452746026696, EPS));
484 assert(cpr.im == c1.im);
488 assert(cmr.im == c1.im);
492 assert(ctr.im == c1.im*a);
507 assert(rmc.im == -c1.im);
522 assert(rec1a.im == 0.0);
526 assert(rec2a.im == 0.0);
529 assert(approxEqual(abs(rec1b), std.math.exp(-PI * c1.im), EPS));
543 assert(approxEqual(rec3a.im, rec3b.im, EPS));
548 assert(approxEqual(rec4a.im, rec4b.im, EPS));
555 assert(rer.im == 0.0);
561 assert(approxEqual(rer2.im, 0.0, EPS));
567 assert(approxEqual(rer3.im, 0.0, EPS));
573 assert(rer4.im == 0.0);
593 assert(c1pcf.im == c1pcr.im);
600 assert(approxEqual(c1c.im, 0.0, EPS));
605 assert(approxEqual(c1c.im, -0.352941, EPS));
609 assert(approxEqual(c2c.im, 0.75, EPS));
614 assert(approxEqual(c2c.im, 0.0, EPS));
621 assert(a.re == 1 && a.im == 0);
623 assert(b.re == 1.0 && b.im == 0);
625 assert(c.re == 1.0 && c.im == 2);
635 assert(z.re == 1.0 && z.im == 0.0);
639 assert(z.re == 2.0 && z.im == 0.0);
643 assert(z.re == 1.0 && z.im == 0.0);
648 assert(z.re == 1.0 && z.im == 1.0);
653 assert(z.re == 2.0 && z.im == 2.0);
686 assert(z1.re == 1.0 && z1.im == 1.0);
701 return hypot(z.re, z.im);
723 return z.re*z.re + z.im*z.im;
762 return atan2(z.im, z.re);
781 return Complex!T(z.re, -z.im);
813 assert(approxEqual(z.im, 1.0L, real.epsilon));
827 auto csh = coshisinh(z.im);
828 return typeof(return)(cs.im * csh.re, cs.re * csh.im);
845 auto csh = coshisinh(z.im);
846 return typeof(return)(cs.re * csh.re, - cs.im * csh.im);
859 feqrel(c1.im, c2.im) >= real.mant_dig - 1);
888 assert(z1.re == z2.re && z1.im == z2.im);
909 real z_im = z.im;
958 assert(approxEqual(c1s.im, 0.45508986));
962 assert(approxEqual(c2s.im, 0.8836155));