Contents | Index | < Browse | Browse >
usage: D2C(number)
or D2C(number [,digits])*
-creates a string whose value is the binary (packed) representation of the given decimal number
*The ARexx manuals ©1991 and ©1995 do not mention a digits argument for d2c(), nor does the online Arexx manual supplied with OS3.9. (Thanks to Stefan Haubenthal for this information. In his IFF2rexx application, Stefan has used D2C(len,4) to get IFF conforming long words.)
Examples:
say c2x(d2c(1555,1)) returns ---> 13
say c2x(d2c(1555,2)) returns ---> 0613
say c2x(d2c(1555,3)) returns ---> 000613
say c2d(d2c(1555,1)) returns ---> 19
say c2d(d2c(1555,2)) returns ---> 1555
say c2d(d2c(1555,3)) returns ---> 1555
say c2d(d2c(1555,4)) returns ---> 1555
say c2b(d2c(1555,1)) returns ---> 00010011
say c2b(d2c(1555,2)) returns ---> 0000011000010011
say c2b(d2c(1555,3)) returns ---> 000000000000011000010011
say c2b(d2c(1555,4)) returns ---> 00000000000000000000011000010011