fend icon indicating copy to clipboard operation
fend copied to clipboard

Is there twos complement boolean representation for signed integers?

Open krishnakumarg1984 opened this issue 2 years ago • 2 comments

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?

krishnakumarg1984 avatar Jun 12 '23 18:06 krishnakumarg1984

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.

printfn avatar Jun 12 '23 19:06 printfn

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.

krishnakumarg1984 avatar Jun 14 '23 20:06 krishnakumarg1984