You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's correct in a sense: negative numbers are encoded with an offset of 1 to avoid having a +0 and a -0. The text to the right of the hex is very much a debug tool, showing the "additional information". It is consistent across all major types (eg. {1:1,2:2} gives A2 # map(2), or false gives F4 # primitive(20)), and always to be interpreted in the context of the major type (for example, the dictionary contains 4 CBOR items, but the additional information is 2 because those 4 CBOR items come in pairs).
One might argue that it'd be helpful to have an interpretation next to it (eg. negative(0) = -1), but then again, that'd be already the full diagnostic format already shown on the left.
The value 0x20 encodes the value -1. The CBOR playground shows the following:
I expected the Bytes view to indicate 20 # negative(1) instead.
The text was updated successfully, but these errors were encountered: