Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: Operate with bits

by soonix (Canon)
on Mar 12, 2020 at 10:08 UTC ( #11114167=note: print w/replies, xml ) Need Help??


in reply to Re^4: Operate with bits
in thread Operate with bits

I assume that for most humans it is easier to see the "finding bit X" problem as one of dealing with strings, than as one of calculating (although, of course, the latter is much easier for the computer).

In other words:

sprintf '%b' converts to a string of bits, then I can take the 7th char from the right
is easier to understand (for most humans) than
If I have it as a number, I simply "AND" it with 26
Of course, it all depends: if there are millions of lines, the inefficiency will add up and become noticeable.

Replies are listed 'Best First'.
Re^6: Operate with bits
by AnomalousMonk (Bishop) on Mar 12, 2020 at 10:32 UTC

    But we're not humans, we're programmers!


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

      Can't disagree, but obviously some programmers are more human than others ;-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2020-06-02 09:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (16 votes). Check out past polls.

    Notices?