complex

fnauto complex(R)(const R re) if (is(R : double)) @safe pure nothrow @nogc

Helper function that returns a complex number with the specified real and imaginary parts.

Parameters

R(template parameter) type of real part of complex number
I(template parameter) type of imaginary part of complex number
rereal part of complex number to be constructed
im(optional) imaginary part of complex number, 0 if omitted.

Returns

Complex instance with real and imaginary parts set

to the values provided as input. If neither re nor im are floating-point numbers, the return type will be Complex!double. Otherwise, the return type is deduced using std.traits.CommonType!(R, I).

fnauto complex(R, I)(const R re, const I im) if (is(R : double) && is(I : double)) @safe pure nothrow @nogc

ditto