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
package main
func exp2(x uint64) float64 {
// valid operations
e := uint64(1) << x
return float64(e)
f := uint64(1 << x)
return float64(f)
return float64(uint64(1 << x))
// 11: invalid operation: 1 << x (shift of type float64)
return float64(uint64(1) << x)
}
The two sets of operations should be equivalent. The first set of operations is
accepted, the second is improperly rejected.
hg id d3e867d23e3e+ tip, 6g, linux, amd64.