Learn R Programming

asbio (version 1.0-5)

bin2dec: Conversion of binary digits to decimal numbers

Description

Converts binary digits e.g. 10101011 to digital numbers. Fractions, e.g. 0.11101 will be evaluated to the number of bits provided. The function will handle whole number and fractions, but not whole numbers with fractional parts, e.g. 111.100110.

Usage

bin2dec(digits, round = 4)

Arguments

digits
A string of binary digits.
round
Rounding for fractional results, defaults to 4.

Examples

Run this code
bin2dec(1011001101) #=717

Run the code above in your browser using DataLab