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

Re: first 5 bits and last 3 bits

by jpl (Monk)
on Jul 26, 2011 at 20:32 UTC ( #916841=note: print w/ replies, xml ) Need Help??


in reply to first 5 bits and last 3 bits

This posting may win some sort of award for ambiguity. What do "first" and "last" mean? Are the "first" the most significant, and the "last" the least significant? If, as the OP added, "it's 8 bits", which 8 bits? The most/least significant? If you strip away leading 0's, as the OP did, is it the 8 bits whose most significant bit is a 1 (which, of course, may not yield 8 bits)? There are many reasonable suggestions here, just as there are many reasonable interpretations of what the heck the OP wants. It doesn't help that the OP offered several suggestions on what the result should be.


Comment on Re: first 5 bits and last 3 bits
Replies are listed 'Best First'.
Re^2: first 5 bits and last 3 bits
by ikegami (Pope) on Jul 26, 2011 at 21:30 UTC

    It doesn't help that the OP offered several suggestions on what the result should be.

    He seems sure of 16, which is indeed the result one gets from taking the most significant 5 bits of an 8 bit number.

    As far as I'm concerned, this clears up the ambiguity, leaving a post that's simply unclear.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2015-07-29 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls