baseConvert | R Documentation |
Converts numbers from one base to another.
baseConvert(x, target, base = 10)
x |
number to convert. If |
target |
target base to convert |
base |
starting base of |
Uses multiplication to convert the number to base 10 and integer division and modulo to convert that to the target base. The starting and target bases must be in the range [2,36].
Character representation of the number in the new base.
baseConvert(231, 16)
baseConvert(231, 2)
baseConvert("7A", 10, 16)
baseConvert("100110110", 10, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.