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

A more number-y Signum #82

Closed
oscbyspro opened this issue Sep 4, 2024 · 2 comments
Closed

A more number-y Signum #82

oscbyspro opened this issue Sep 4, 2024 · 2 comments
Labels
addition oh, so shiny! subtraction huh? where did it go?

Comments

@oscbyspro
Copy link
Owner

oscbyspro commented Sep 4, 2024

The current Signum model is basically a terse comparison result with some integer-like utilities. It is apparent—since BinaryInteger got operations like as isNegative, isZero, and isPositive—that Signum would be much more interger-like if its cases were negative, zero, and positive. In that case, operations like isNegative, isZero, and isPositive would make sense on Signum too. It might result in less context switching, or something to that effect.

@oscbyspro oscbyspro added addition oh, so shiny! subtraction huh? where did it go? labels Sep 4, 2024
@oscbyspro
Copy link
Owner Author

oscbyspro commented Sep 4, 2024

I also suspect that Signum.init(_: Sign?) is preferred over Signum.one(_: Sign).

@oscbyspro oscbyspro added this to the Ultimathnum 0.9.0 milestone Sep 4, 2024
@oscbyspro
Copy link
Owner Author

I'll add a mutating version of negated() since binary integers have negate() now (#80).

oscbyspro added a commit that referenced this issue Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition oh, so shiny! subtraction huh? where did it go?
Projects
None yet
Development

No branches or pull requests

1 participant