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

IndexError with a = a +b #27

Closed
pietroppeter opened this issue May 13, 2020 · 0 comments · Fixed by #35
Closed

IndexError with a = a +b #27

pietroppeter opened this issue May 13, 2020 · 0 comments · Fixed by #35

Comments

@pietroppeter
Copy link
Contributor

expected to work:

import bigints

var
  a = 0.initBigInt
  b = "359097073186387306".initBigInt

a = a + b  # Error: unhandled exception: index out of bounds, the container is empty [IndexError]

The above seems to work if b < uint32.high.

With a temporary variable it works:

import bigints

var
  a = 0.initBigInt
  b = "359097073186387306".initBigInt
  t: BigInt

# with a temporary variable t it works
t = a + b
a = t
echo a

for context where this came from, see https://forum.nim-lang.org/t/6327

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

Successfully merging a pull request may close this issue.

1 participant