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

DataInt/isCompact #28

Closed
oscbyspro opened this issue Jun 22, 2024 · 3 comments
Closed

DataInt/isCompact #28

oscbyspro opened this issue Jun 22, 2024 · 3 comments
Labels
addition oh, so shiny!

Comments

@oscbyspro
Copy link
Owner

oscbyspro commented Jun 22, 2024

Asking whether the last bit in the body extends the bit pattern is another useful query. It is not complicated, but it is quite wordy so it might deserves a name. It's currently simpler to go through DataInt/entropy(), which is obviously a roundabout way of doing it.

@oscbyspro oscbyspro added the addition oh, so shiny! label Jun 22, 2024
@oscbyspro oscbyspro added this to the Ultimathnum 0.6.0 milestone Jun 22, 2024
@oscbyspro
Copy link
Owner Author

oscbyspro commented Jun 23, 2024

Hm. I suspect that the inverse might be more appropriate. The implementation and behavior of DataInt/isExtended is much more similar to DataInt/isNormal. Both would perform an inequality check and return true when DataInt.Body/isEmpty.

@oscbyspro
Copy link
Owner Author

oscbyspro commented Jun 23, 2024

This is the moment when you wish computers worked at the bit level so you could reasonably use DataInt<U1> and call DataInt/isNormal instead of introducing a new concept. Like, I could call it DataInt/isNormal(Bit.self) or something to that effect. Alternatively, I could add a bitwise view but I have done that twice and removed it twice already.

@oscbyspro
Copy link
Owner Author

oscbyspro commented Jun 23, 2024

Perhaps some conveniences is enough:

body.last?.msb != appendix

@oscbyspro oscbyspro closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition oh, so shiny!
Projects
None yet
Development

No branches or pull requests

1 participant