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

Return errors instead of panicking #599

Open
samueltardieu opened this issue Sep 11, 2024 · 0 comments
Open

Return errors instead of panicking #599

samueltardieu opened this issue Sep 11, 2024 · 0 comments

Comments

@samueltardieu
Copy link
Collaborator

Right now, the various algorithms in which arithmetic operations happen may panic if, for example, bounds are exceeded. Using saturating arithmetic is not possible because it could silently yield incorrect results, and the current type bounds do not allow using either saturating or checked arithmetic. Moreover, using unchecked arithmetic operations may lead to different results in debug (panic) and release (silent wrapping) modes.

Requiring checked arithmetic and using Result types would constitute a better behavior. This change requires breaking the API and will require a major release.

This has been reported in #598.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant