[phobos] Is anyone working on std.complex?

Don Clugston dclugston at googlemail.com
Fri Mar 26 22:20:32 PDT 2010


On 27 March 2010 02:14, Walter Bright <walter at digitalmars.com> wrote:
>
>
> Andrei Alexandrescu wrote:
>>
>> * Some asserts before division by zero would be helpful. Carrying through
>> with silent NaNs annoy the heck out of anyone.
>>
>
> I don't agree. Complex arithmetic behavior should mirror IEEE 754 floating
> point behavior as far as exceptions and NaNs go.

Yes, enable the division by zero exception if you don't want NaNs.

Secondly, the modulus operation should use std.math.hypot().  You can
copy the implementation from std.math.abs.
I think it should probably be called abs() rather than mod(). Mod has
such as strong connotation of %, that it's bound to cause confusion.
Everything else looks pretty good.


> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>


More information about the phobos mailing list