[Issue 18571] Missing functions in std.complex

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 8 10:32:14 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18571

Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simen.kjaras at gmail.com
            Summary|log for Complex             |Missing functions in
                   |                            |std.complex

--- Comment #1 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
Not just log, either - all of the following functions are missing:
acos, acosh, approxEqual, asin, asinh, atan, atan2, atanh, cbrt, ceil,
copysign, cosh, exp, floor, isInfinity, isNaN, log, log10, log2, poly, pow,
round, sgn, sinh, tan, tanh, trunc.

Naïve implementations of every one of those are available here:
https://gist.github.com/Biotronic/17af645c2c9b7913de1f04980cd22b37

There's probably plenty of optimization opportunities, as very little attempt
has been made to make the functions fast, but they should provide a starting
point for anyone wanting to make something better.

There are other functions in std.math that might make sense to implement for
complex numbers, like remainder, scalbn, exp2, expm1, ldexp, quantize, and
hypot.

--


More information about the Digitalmars-d-bugs mailing list