Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^8: Split any number into string of 8-bit hex values (=1 byte)

by soonix (Canon)
on Aug 31, 2021 at 07:04 UTC ( #11136270=note: print w/replies, xml ) Need Help??


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:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11136270]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2021-10-25 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (89 votes). Check out past polls.

    Notices?