[project @ 1999-02-03 16:53:16 by simonm]
authorsimonm <unknown>
Wed, 3 Feb 1999 16:53:16 +0000 (16:53 +0000)
committersimonm <unknown>
Wed, 3 Feb 1999 16:53:16 +0000 (16:53 +0000)
Fix accidental defaulting to Integer in magnitude.

ghc/lib/std/Complex.lhs

index f92144e..53f0f53 100644 (file)
@@ -71,7 +71,7 @@ polar z                =  (magnitude z, phase z)
 
 magnitude :: (RealFloat a) => Complex a -> a
 magnitude (x:+y) =  scaleFloat k
-                    (sqrt ((scaleFloat mk x)^2 + (scaleFloat mk y)^2))
+                    (sqrt ((scaleFloat mk x)^(2::Int) + (scaleFloat mk y)^(2::Int)))
                    where k  = max (exponent x) (exponent y)
                          mk = - k