Skip to content

Add saturating_sub helper function - #5620

Open
jtraglia wants to merge 1 commit into
ethereum:masterfrom
jtraglia:saturating-sub
Open

Add saturating_sub helper function#5620
jtraglia wants to merge 1 commit into
ethereum:masterfrom
jtraglia:saturating-sub

Conversation

@jtraglia

Copy link
Copy Markdown
Member

In #5606, we discussed the idea of adding a saturating subtraction function to improve readability and remove the need for ugly type casts. This does just that. One thing worth explicitly noting is that the 2nd parameter (b) is an int type so we can use literal values like 0, 1, etc without needing to cast them.

@jtraglia
jtraglia requested a review from jihoonsong September 10, 2026 15:06
@jtraglia jtraglia changed the title Add a saturating_sub helper function Add saturating_sub helper function Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant