FromDigits

FromDigits[list]

constructs an integer from the list of its decimal digits.

FromDigits[list,b]

takes the digits to be given in base b.

FromDigits[list,MixedRadix[blist]]

uses the mixed radix with list of bases blist.

FromDigits["string"]

constructs an integer from a string of digits.

FromDigits["string","Roman"]

constructs an integer from Roman numerals.

Details

Examples

open allclose all

Basic Examples  (5)

Construct a number from its base-10 digits:

Base-2 digits:

Construct a number from digits given as string:

Construct a number from digits base 2:

Construct a number from digits in a mixed radix system:

Scope  (5)

Use symbolic digits and base:

Digits larger than the base are "carried":

Reconstruct a rational number from recurring digits:

Reconstruct a number from its digits in a mixed radix system:

Convert from Roman numerals:

Generalizations & Extensions  (1)

Construct a number with limited precision:

Applications  (3)

Find the number with recurring digits 123:

Find numbers with successive recurring binary digit sequences:

Properties & Relations  (1)

Reconstruct a number of seconds from a list {days,hours,minutes,seconds}:

It can also be obtained with NumberCompose:

Perform the same computation using Quantity objects:

Possible Issues  (3)

IntegerDigits drops the sign:

Without a base specified, the characters are interpreted as extensions of base-10 digits:

If no base is specified, the multicharacter strings are converted using base 10:

Introduced in 1996
 (3.0)
 |
Updated in 1999
 (4.0)
2000
 (4.1)
2002
 (4.2)
2007
 (6.0)
2015
 (10.2)