[Issue 6154] std.math.abs on std.complex numbers too

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 14 06:31:23 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6154


kennytm at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kennytm at gmail.com


--- Comment #1 from kennytm at gmail.com 2011-06-14 06:26:44 PDT ---
(In reply to comment #0)
> In DMD 2.053 if you want to do the same with complex numbers you need to write:
> 
> import std.stdio, std.math, std.algorithm, std.complex;
> void main() {
>     alias Complex!double C;
>     C[] array2 = [C(1,2), C(2,4)];
>     auto m2 = map!((c){ return c.abs(); })(array2);
>     writeln(m2);
> }

    auto m2 = map!`a.abs()`(array2);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list