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
{{ message }}
Repository navigation
cmd/compile: finite scaling of complex infinity gives complex NaN #38757
changed the title [-]cmd/compile: finite scaling of complex infinity give complex NaN[/-][+]cmd/compile: finite scaling of complex infinity gives complex NaN[/+]on Apr 30, 2020
This is working as intended. The issue is the untyped constant 42 is converted to a complex number with zero imaginary part and the multiplication between Inf and 0.0 is NaN.
Activity
[-]cmd/compile: finite scaling of complex infinity give complex NaN[/-][+]cmd/compile: finite scaling of complex infinity gives complex NaN[/+]bmkessler commentedon May 1, 2020
This is working as intended. The issue is the untyped constant 42 is converted to a complex number with zero imaginary part and the multiplication between Inf and 0.0 is NaN.
To scale by a real number rather than multiply by a complex number with zero imaginary part you need to write this as:
See #38780 for further discussion.
kortschak commentedon May 1, 2020
Yeah, OK. The spec is terse on this. As mentioned in the linked issue, perhaps that could be improved.