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

Simen Kjaeraas <simen.kja...@gmail.com> changed:

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

--- Comment #1 from Simen Kjaeraas <simen.kja...@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.

--

Reply via email to