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

make Base.uabs public 2 #53503

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

make Base.uabs public 2 #53503

wants to merge 3 commits into from

Conversation

nhz2
Copy link
Contributor

@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
Contributor 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
Contributor Author

nhz2 commented Jan 3, 2025

Bump.

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

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