Pathologically Eclectic Rubbish Lister PerlMonks

### Re^4: When I see "10", I think:

by ikegami (Pope)
 on Mar 02, 2013 at 16:05 UTC ( #1021445=note: print w/replies, xml ) Need Help??

in reply to Re^3: When I see "10", I think:
in thread When I see "10", I think:

Using octal for 16-bit values is that it isolates bit 15 nicely.

```FFFF(hex) = 177777(oct)
8000(hex) = 100000(oct)
7FFF(hex) = 077777(oct)
0000(hex) = 000000(oct)

Replies are listed 'Best First'.
Re^5: When I see "10", I think:
by BrowserUk (Pope) on Mar 02, 2013 at 16:52 UTC

If the left-most hex digit is 8 or higher, the high bit is set.

That's all you got?

You dig up an old thread to say: "Using octal for 16-bit values is that it isolates bit 15 nicely."

And when you are shown that isolating the high bit in hex is trivial; you then say; "Oh, but it's not about the high bit; its about the other 15".

Were you bored and just came looking for a argument?

Well here it is. Translating hex nibbles to binary is child's play. Every programmer worthy of the name does in their head without thinking.

The advantage over octal is obvious. (hint:byte alignment).

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Create A New User
Node Status?
node history
Node Type: note [id://1021445]
help
Chatterbox?
 [Corion]: hippo: If you have a Unicode-wise Perl then likely some zero-width characters in \$x would work. Maybe \$x = "\x{200b}" works. [Corion]: Hmm - no, that outputs 1 for me on 5.14 - perl -wle "my \$x = qq(\x{200b}); warn \$x; warn length \$x" [hippo]: Smart - I'll give that a go. Thanks. [hippo]: Ah [Corion]: But maybe there is some other Unicode string that will be true but have a zero width [hippo]: For explanation, I've seen this construct in someone else's code (no names, no pack drill) and couldn't think of a situation to trigger it. [Corion]: You'll have to look somewhere esoteric for that. Maybe some tied variable or special dualvar can also trigger that. But it's certainly not a common occurrence [Corion]: And on 5.20, the following also outputs no find:perl -wle 'for my \$x ("\x{2000}".."\ x{1fffff}") { if( \$x && ! length \$x ) { warn qq(<\$x>); warn length \$x; die } }' [Corion]: (this time on Unix)

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2017-07-27 13:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
I came, I saw, I ...

Results (413 votes). Check out past polls.