b2d: Conversions between binary and decimal numbers

Description Usage Arguments Value See Also Examples

View source: R/b2d.R

Description

These functions convert between binary numbers (as numeric vectors) and decimal numbers.

Usage

1
2
b2d(bin)
d2b(dec)

Arguments

bin

numeric vector of 0s and 1s representing the number in binary format

dec

numeric non-negative scalar, decimal number to be converted

Value

For b2d the decimal number representing the binary input. For d2b the numeric vector representing the decimal as binary number: sequence of 0s and 1s.

See Also

bin2dec and dec2bin for more user friendly interface.

Examples

1
2
b2d(c(1, 1, 0, 1))
d2b(13)

rgraph6 documentation built on May 2, 2019, 4:50 p.m.