Skip to content

feat(StdMath): Add INT256_MIN_ABS constant to avoid magic number dupl… #689

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

Closed
wants to merge 1 commit into from

Conversation

reallesee
Copy link

Introduces a new constant INT256_MIN_ABS in the stdMath library to store the absolute value of INT256_MIN. The abs() function now uses this constant instead of duplicating the magic number. This change improves code readability, maintainability, and follows the DRY principle. It also prevents potential overflow issues that could occur when trying to calculate -INT256_MIN directly.

@DaniPopes
Copy link
Member

Thanks but this is unnecessary because it's used only once

@DaniPopes DaniPopes closed this Jul 31, 2025
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 this pull request may close these issues.

2 participants