 binary - Maple Help

# Online Help

###### All Products    Maple    MapleSim

convert/binary

convert to binary form Calling Sequence convert(n, binary) Parameters

 n - decimal number Description

 • The function convert/binary'' converts a decimal number n to a binary number.  The number may be either positive or negative, and may be either an integer or a floating-point number.  In the case of a floating-point number, an optional third argument determines the total number of digits of precision in the answer (the default being Digits).
 • The binary number is returned as a base 10 number consisting of the digits 1 and 0 only. Examples

 > $\mathrm{convert}\left(123,\mathrm{binary}\right)$
 ${1111011}$ (1)
 > $\mathrm{convert}\left(-5,\mathrm{binary}\right)$
 ${-101}$ (2)
 > $\mathrm{convert}\left(12.34,\mathrm{binary}\right)$
 ${1100.010101}$ (3)
 > $\mathrm{convert}\left(\mathrm{evalf}\left[16\right]\left(\mathrm{\pi }\right),\mathrm{binary},53\right)$
 ${11.001001000011111101101010100010001000010110100010111}$ (4)

 See Also