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
'hexadecimal' tends to imply "unsigned values" in programming. As an example reference the first link on searching for "printf format specifiers" says "Unsigned hexadecimal integer". Others say "unsigned int" and the like.
Hexadecimal in code is most often used to represent exact binary values concisely, including binary values that would be interpreted as negative by hardware. Hexadecimal in code is not just another number base.
While there is a '%u' for decimal numbers, to switch between signed and unsigned integer, that's a rare usage. (I've only used it when I wanted a 'bad' negative integer to be really obvious visually) The only variation I've needed for hexadecimal is covered by '%X' (which I use always)
So... sprintf-js is doing exactly the "industry-standard" thing. (I hate that term 😄) Anything else would be surprising.
If you really want signed hexadecimal, some variation on this is needed:
I would have expected
-1304
, any recommendations?The text was updated successfully, but these errors were encountered: