http://www.perlmonks.org?node_id=11136270


in reply to Re^7: Split any number into string of 8-bit hex values (=1 byte)
in thread Split any number into string of 8-bit hex values (=1 byte)

Note that for 200, C8 is a negative number, so the 00 is required to make it so that C8 00 is positive.
Ah, that might be the reason for that odd trailing '00' in the OP
  • Comment on Re^8: Split any number into string of 8-bit hex values (=1 byte)

Replies are listed 'Best First'.
Re^9: Split any number into string of 8-bit hex values (=1 byte)
by AnomalousMonk (Bishop) on Aug 31, 2021 at 07:49 UTC

    How does an 8-bit register in an I2C device "know" that an 0xc8 byte started out as 20010 or as -5610? One can make similar arguments about 16- and 32-bit registers.

    I share the misgivings expressed by LanX here.


    Give a man a fish:  <%-{-{-{-<