You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But some functions from Data.Complex (log, sqrt) use magnitude, which uses scaleFloat and exponent from RealFloat. While scaleFloat works, exponent throws an error.
magnitude:: (RealFloata) =>Complexa->a
magnitude (x:+y) =scaleFloat k
(sqrt (sqr (scaleFloat mk x) + sqr (scaleFloat mk y)))
where k =max (exponent x) (exponent y)
mk =- k
sqr z = z * z
I have tried changing exponent to
exponent _ =0
and it works just fine, tests are passing.
The text was updated successfully, but these errors were encountered:
I want to use
Data.Complex
to do tricks like this:But some functions from
Data.Complex
(log
,sqrt
) usemagnitude
, which usesscaleFloat
andexponent
fromRealFloat
. WhilescaleFloat
works,exponent
throws an error.I have tried changing
exponent
toand it works just fine, tests are passing.
The text was updated successfully, but these errors were encountered: