[Haskell-beginners] Can't square zero as a complex number?

Scott N. Walck walck at lvc.edu
Thu Jul 26 18:08:00 CEST 2012


Hi,

Is there a reason why I can't use ** to square zero as a complex number?

Prelude> :m Data.Complex
Prelude Data.Complex> (0:+0) ** 2
NaN :+ NaN
Prelude Data.Complex> (0 :: Complex Double) ** 2
NaN :+ NaN

Using GHC 7.4.1.

Thanks,

Scott



More information about the Beginners mailing list