true has asked for the wisdom of the Perl Monks concerning the following question:
I get 00110010001100010011000000110000print unpack("B*",2100)."\n";
i get 0011001100110100print unpack("B*",34)."\n";
WHY??
I'm generating a .swf file from perl. A vector rectangle has four points stored in the .swf file. These values have to be converted into binary then layed together side by side, and finally packed into the swf file. Because these shifted values are spread across the entire file, i have to convert them to binary, then translated their value.
Also note. 2100 = '0011 0100' is the result i get from using my Dimdow's calculator. I'm trying to mimic that conversion in perl. thanks for reading.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: convert decimal to binary with unpack problem
by pfaut (Priest) on Jan 16, 2003 at 19:22 UTC | |
|
Re: convert decimal to binary with unpack problem
by thinker (Parson) on Jan 16, 2003 at 19:24 UTC | |
|
Re: convert decimal to binary with unpack problem
by Mr. Muskrat (Canon) on Jan 16, 2003 at 19:32 UTC | |
|
Re: convert decimal to binary with unpack problem
by BrowserUk (Patriarch) on Jan 16, 2003 at 19:34 UTC | |
|
Re: convert decimal to binary with unpack problem
by true (Pilgrim) on Jan 16, 2003 at 19:56 UTC |