Skip to content

Removesafe_ prefixes from div functions - #59

Open
aritkulova wants to merge 1 commit into
devfrom
fix/consistent-naming
Open

aritkulova wants to merge 1 commit into
devfrom
fix/consistent-naming

Conversation

@aritkulova

Copy link
Copy Markdown
Collaborator
  • This PR suggests a bug fix and I've added the necessary tests.
  • This PR introduces a new feature and I've discussed the update in an Issue or with the team.
  • This PR is just a minor change like a typo fix.

This PR is a follow-up to #57 and makes naming of div_ functions consistent .

@aritkulova aritkulova self-assigned this Sep 28, 2026
@aritkulova
aritkulova requested a review from Hrom131 September 28, 2026 09:51
@Hrom131

Hrom131 commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

@aritkulova

What do you think about removing the safe_ prefix from all the remaining math operations (add, mul, sub)? It seems a little odd that they all still have the prefix, while div doesn't. I think we should keep the checked_ prefix and leave the functions without a prefix, which are safe by default.

@aritkulova

aritkulova commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

@Hrom131
Although add, sub, and mul still make sense as operations that can potentially overflow, I agree that removing the safe_ prefix would be more consistent.
I believe we should keep the current add, sub, and mul for u128 and u256 as unsafe_, since they are still useful. Should we return unsafe_div (for u128 and u256) for consistency then?

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