Skip to content

Make safe_divide safer.#2123

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_900660861
May 11, 2026
Merged

Make safe_divide safer.#2123
copybara-service[bot] merged 1 commit into
mainfrom
test_900660861

Conversation

@copybara-service
Copy link
Copy Markdown

@copybara-service copybara-service Bot commented Apr 16, 2026

Make safe_divide safer.

The current danger of safe_divide is it's easy not to think about numerics and what your edge case behaviour where something goes to zero should be. Making eps a required argument of safe_divide also forces us to think about the numerics involved.

@copybara-service copybara-service Bot force-pushed the test_900660861 branch 2 times, most recently from 88112e2 to 45fd081 Compare May 11, 2026 15:18
The current danger of safe_divide is it's easy not to think about numerics and what your edge case behaviour where something goes to zero should be. Making eps a required argument of safe_divide also forces us to think about the numerics involved.

PiperOrigin-RevId: 913713697
@copybara-service copybara-service Bot merged commit 2cd72d7 into main May 11, 2026
1 check passed
@copybara-service copybara-service Bot deleted the test_900660861 branch May 11, 2026 15:33
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.

1 participant