Skip to content

Conversation

@chiphogg
Copy link
Member

@chiphogg chiphogg commented Jul 9, 2025

Currently, we can't represent -mag<128>() in int8_t, even though the
value -128 is representable. The problem is that we're using the
max of the type to decide what we can represent, and then just negating
it. This special case logic enables us to handle all integer values
correctly.

Helps pave the way for #349.

Currently, we can't represent `-mag<128>()` in `int8_t`, even though the
value `-128` _is_ representable.  The problem is that we're using the
max of the type to decide what we can represent, and then just negating
it.  This special case logic enables us to handle all integer values
correctly.

Helps pave the way for #349.
@chiphogg chiphogg merged commit b21c1be into main Jul 9, 2025
14 checks passed
@chiphogg chiphogg deleted the chiphogg/get-value-lowest-signed-integral#349 branch July 9, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants