Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tobias Decking
GHC
Commits
30a1a03f
Commit
30a1a03f
authored
Feb 03, 1999
by
simonm
Browse files
[project @ 1999-02-03 16:53:16 by simonm]
Fix accidental defaulting to Integer in magnitude.
parent
46dfa530
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/lib/std/Complex.lhs
View file @
30a1a03f
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment