[Haskell-cafe] Complex numbers and (**)

Henning Thielemann lemming at henning-thielemann.de
Sat Aug 8 13:17:05 EDT 2009


On Sat, 8 Aug 2009, Paul Sargent wrote:

> First post to the cafe, so "Hello everybody!".
> Hope this is reasonable subject matter and not too long.
> 
> I've been working on some algorithms that involved taking the n-th root of complex numbers.
> In my code I've implemented this as raising the complex number ('z') to 1/n using the (**)
> operator. Obviously, there are n roots, but I only need one of them so this is fine.

I have written something on that topic:
   http://haskell.org/haskellwiki/Power_function

I think the problem cannot be fully solved, especially not within the 
Haskell 98 numeric type classes. There is no satisfying implementation of 
(**) even for Float and Double.


More information about the Haskell-Cafe mailing list