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

Range operator only works in long range #1288

Open
mschoeb opened this issue Jan 23, 2025 · 0 comments
Open

Range operator only works in long range #1288

mschoeb opened this issue Jan 23, 2025 · 0 comments

Comments

@mschoeb
Copy link
Collaborator

mschoeb commented Jan 23, 2025

Ranges with values outside of long ranges result in an overflow.

(-1000000000000000000003 to -1000000000000000000000) gives us
-3875820019684212739
-3875820019684212738
-3875820019684212737
-3875820019684212736

The problem with doing just integerItems is that they use BigInteger internally resulting in a performance hit. Ideas for a fix from a meeting between me and Ghislain:

  • Possibly add a check for the range and if it is outside of long range, do IntegerItems instead
  • Go down one step further and update IntegerItem to be able to handle regular ints. If the value is small enough, it gets saved as a int, if not it will be a BigInteger. This could also help performance in many other places using integerItems (since its encapsulated, the class can handle things internally however it wants. But we might need to change the interface a bit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant