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

Error indicator for infinite-by-finite remainder #68

Closed
oscbyspro opened this issue Aug 10, 2024 · 2 comments
Closed

Error indicator for infinite-by-finite remainder #68

oscbyspro opened this issue Aug 10, 2024 · 2 comments
Labels
bug please fix this :(

Comments

@oscbyspro
Copy link
Owner

oscbyspro commented Aug 10, 2024

Finite remainders are always well-behaved. 3/4 infinite remainder cases are well-behaved. But, infinite-by-finite remainders are not because infinite-by-finite division is an error (reinterpreted as signed). BinaryInteger/remainder(_:) should, therefore, return an error indicator. I can add a FiniteInteger/remainder(_:) that never fails for the sake of convenience.

@oscbyspro oscbyspro added the bug please fix this :( label Aug 10, 2024
@oscbyspro oscbyspro added this to the Ultimathnum 0.9.0 milestone Aug 10, 2024
@oscbyspro
Copy link
Owner Author

oscbyspro commented Aug 10, 2024

Alternatively, I could ban infinite-by-whatever division altogether. Hm.

@oscbyspro oscbyspro changed the title Indicator error for infinite-by-finite remainder Error indicator for infinite-by-finite remainder Aug 10, 2024
@oscbyspro
Copy link
Owner Author

oscbyspro commented Oct 12, 2024

I'll resolve this issue and (#69) once I have rewritten all division tests using swift-testing (#110).

oscbyspro added a commit that referenced this issue Oct 21, 2024
This rewrite introduces safe division protocol requirements with proper division semantics. I'm sure these methods can be derived from unsafe requirements, but this is a good place to start. I'll may consider unsafe requirements if the overhead of safety cannot be optimized away. Something, something, sufficiently smart compiler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug please fix this :(
Projects
None yet
Development

No branches or pull requests

1 participant