Skip to content

Conversation

@nhz2
Copy link
Member

@nhz2 nhz2 commented Feb 28, 2024

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

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

@nhz2 nhz2 mentioned this pull request Feb 28, 2024
@KristofferC
Copy link
Member

What's the reason not to export this?

@nhz2
Copy link
Member Author

nhz2 commented Feb 28, 2024

This function is mostly used by packages defining new Integer or AbstractFloat types. I think it is kind of like Base.add_sum(x, y): a method that can be optionally extended to make a custom type work better with generic methods in Base. So I don't think there is a need to export it and create potential naming conflicts.

@nhz2
Copy link
Member Author

nhz2 commented Jan 3, 2025

Bump.

This will help fix an issue in CSV.jl Ref: JuliaData/CSV.jl#1152

@ViralBShah
Copy link
Member

Bump. Should we merge or close?

@nhz2 nhz2 added the design Design of APIs or of the language itself label Sep 2, 2025
@adienes adienes merged commit b2f8ee8 into JuliaLang:master Sep 3, 2025
7 checks passed
@nhz2 nhz2 deleted the nz/public-uabs branch September 3, 2025 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design Design of APIs or of the language itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants