Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: hexadecimal division

by ikegami (Pope)
on Dec 18, 2017 at 16:12 UTC ( #1205802=note: print w/replies, xml ) Need Help??


in reply to hexadecimal division

What I expect is 5/16 converted to an int which is the NUL characted (0x00) which the API show as X'00'.

Two errors in there.

  1. Division produces a number, not a string. You should be expecting the result to be zero, not a string.
  2. Hex is a text representation of a number. X'00' represents the number zero, not a string.

Replace

print sprintf("%02X ", ord($result2)) . "\n";
with
print sprintf("%02X ", $result2) . "\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1205802]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2018-02-24 12:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (310 votes). Check out past polls.

    Notices?