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

Prevent -generation when long overflow for antimatter gen. #3378

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

lordIcocain
Copy link
Contributor

No description provided.

@Dream-Master Dream-Master requested a review from a team October 20, 2024 09:50
@Dream-Master Dream-Master added the bug fix Fix a bug. Please link it in the PR. label Oct 20, 2024
@chochem chochem changed the title Prevent -generation when long overflow. Prevent -generation when long overflow for antimatter gen. Oct 21, 2024
@RecursivePineapple
Copy link
Contributor

RecursivePineapple commented Oct 25, 2024

@lordIcocain It looks like this just moves the problem a bit. Is it possible for the generation to be high enough that it wraps around to >0 again?
I'd prefer to see an addition util method that will return Long.MAX_VALUE when normal addition would wrap instead of this, but if it won't ever wrap around to >0 then this solution is fine.

@lordIcocain
Copy link
Contributor Author

@RecursivePineapple i didn't test with super high generations, but it's on non-standard use category. My goal is prevent overflow for situation when you want to generated as close to long max as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Fix a bug. Please link it in the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants