Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Binary data type?

by thor (Priest)
on Oct 16, 2002 at 23:40 UTC ( [id://205883]=note: print w/replies, xml ) Need Help??


in reply to Binary data type?

One thing that I notice right off of the bat is that you have three distinct values that you're trying to store. One bit is not sufficient for storage as it only has two states. You could use trinary, where each tit (bit is short for binary digit, so tit is short for trinary digit, I guess) could have values of 0, 1, or 2. Also, are conditions A, B, and C mutually exclusive? If not, then you need even more storage, as setting the tit for one value will clober what was there. I would advise against using tits, however, as you lose the usefullness of such operators as << and & for masking operations.

thor

Replies are listed 'Best First'.
Re: Re: Binary data type?
by diotalevi (Canon) on Oct 16, 2002 at 23:54 UTC

    The word you're looking for is "trit".

    __SIG__ printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2024-04-23 13:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found