home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1997 #3
/
amigamamagazinepolishissue03-1
/
polski_aminet
/
michal_durys
/
binconv.doc
next >
Wrap
Text File
|
1996-05-06
|
2KB
|
59 lines
-= binConv =-
INTRODUCTION
~~~~~~~~~~~~
binConv is something I wrote in 20 minutes. It's small module which contains
procedures to convert any number to binary number (e.g.: %1010111001). It's
quite useful since there's no operator for binary number like \d for
decimals.
DISTRIBUTION
~~~~~~~~~~~~
This is public domain.
USAGE
~~~~~
Module contains two procs:
o convLong2Bin()
o cutZeros()
NAME:
convLong2Bin()
INPUTS:
Number to convert, e.g.: 7,9,$CAFE or even %101101101
RESULT:
E-string (32 characters long) containing binary representation of given
number.
EXAMPLE:
...
DEF binnum
binnum:=convLong2Bin($CAFE)
/* Now binnum is '00000000000000001100101011111110' */
NAME:
cutZeros()
INPUTS:
String containing binary representation of number, like '0010110'
RESULT:
New e-string containing binary number without superfluous zeros
EXAMPLE:
...
-> bin is '000000010101110'
newbin:=cutZeros(bin)
/* newbin now is '10101110' */
Look at bintest.e to see how it works.
AUTHOR
~~~~~~
If you want to contact with me, write to:
Michal Durys
ul. Konarskiego 48/12
01-355 Warszawa
POLAND