Skip to content

Conversation

@nhz2
Copy link
Contributor

@nhz2 nhz2 commented Jan 2, 2024

This PR adds support for Base.uabs

Base.uabs is useful when trying to avoid the overflow error with abs(typemin(SafeInt))

@JeffreySarnoff JeffreySarnoff merged commit fa81a4f into JeffreySarnoff:main Jan 3, 2024
@JeffreySarnoff
Copy link
Owner

thank you

adienes pushed a commit to JuliaLang/julia that referenced this pull request Sep 3, 2025
`Base.uabs` is helpful when writing code that works with generic
integers without worrying about silent overflows or overflow errors when
using integers from
[SaferIntegers.jl](https://github.com/JeffreySarnoff/SaferIntegers.jl)

`Base.uabs` is already being used by a few packages
https://juliahub.com/ui/Search?q=uabs&type=code&w=true and has a
docstring. However, it is currently an internal function.

Ref: JeffreySarnoff/SaferIntegers.jl#41

Copy of #53376
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