08-14-2002, 12:33 AM
Does anyone know a good way to convert a decimal number to the binair-system?
(I'd prefer a sub, returning the binair value)
Thanks in advance.
08-14-2002, 01:52 AM
Set the 32 number to the number of bits you actually need if you don't want preceeding zeros - but it must be a binary power of two to be valid, ie, 1,2,4,8,16,32 (maximum).
08-14-2002, 09:09 AM
Thanks man, the code works.
But I'd like to understand it too...
I'm not quiet a newB to Perl, but I don't understand the code, could you explain it for me?
08-14-2002, 09:15 AM
I'll have it figured out as soon as I break out the Perl source code for the VEC function!
Honestly I don't have a single clue as to how the VEC function works... Out of three really good books, the longest mention of it is less than half a page.
I just lucked out in finding it.... Credit the books for this one!