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

Is there twos complement boolean representation for signed integers? #218

Open
krishnakumarg1984 opened this issue Jun 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@krishnakumarg1984
Copy link

krishnakumarg1984 commented Jun 12, 2023

Consider the binary value 1011 0100. Its decimal conversion would be:

  • 180 if it is an unsigned binary number
  • -76 if this is a signed binary number using standard two’s complement arithmetic.

Is there a way to instruct fend about this?

@printfn
Copy link
Owner

printfn commented Jun 12, 2023

This is not currently supported, mostly because fend does not have a notion of fixed-width binary numbers. This is also why bitwise negation is not implemented. It’d definitely be nice for this to eventually be supported though.

@krishnakumarg1984
Copy link
Author

No problems. If this is on your backlog and you might get to it some day in the future, I am happy to leave this issue open.

@printfn printfn added the enhancement New feature or request label Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants