Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: 3-byte representation (Simplified!)

by BrowserUk (Pope)
on Oct 13, 2011 at 00:49 UTC ( #931117=note: print w/ replies, xml ) Need Help??


in reply to Re^2: 3-byte representation (Simplified!)
in thread 3-byte representation

my $packed = pack '(l<X)*', @array; is more concise, probably faster

That's clever, but does have the limitation that you cannot produce a big-endian stream.

Mind, I don't know if there is any hardware that accepts 24-bit BE values.

A shame there seems to be no way to get rid of the final map on the unpacking side.

Agreed. This isn't the first time that I've wished that pack would allow the insertion of values from the template.

I've also wished for a more generic version of vec that allowed arbitrary numbers of bits, rather than just powers of 2.


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.


Comment on Re^3: 3-byte representation (Simplified!)
Download Code
Re^4: 3-byte representation (Simplified!)
by johngg (Abbot) on Oct 13, 2011 at 14:33 UTC
    Mind, I don't know if there is any hardware that accepts 24-bit BE values.

    I don't know if there are still any out in the wild and I don't recall their endian-ness but ICL 1900 series machines used a 6-bit character representation and had 24-bit words.

    Update: Corrected typo, supplied missing word :-(

    Cheers,

    JohnGG

      I'm pretty sure that the only 6-bit byte machines still running -- if any at all -- will be in museums.

      These days, the most likely candidates are DACS, sound-cards, maybe video, and GPS type hardware.


      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://931117]
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: (5)
As of 2014-07-29 03:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls