Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly assumes int64 when bit shifting #1661

Open
Chicken935 opened this issue Sep 17, 2024 · 0 comments
Open

Incorrectly assumes int64 when bit shifting #1661

Chicken935 opened this issue Sep 17, 2024 · 0 comments

Comments

@Chicken935
Copy link

The following program sample.go triggers an unexpected result

package main

func main() {
  uint64array := make([]uint64, 1)
  uint64array[0] = 1 << 63

  var bigNumber uint64 = 1 << 63

  println(uint64array[0])
  println(bigNumber)
}

Expected result

$ go run ./sample.go
// 9223372036854775808
// 9223372036854775808

Got

yaegi ./sample.go
// constant 9223372036854775808 overflows int64

Yaegi Version

v0.16.1

Additional Notes

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant