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:

Wolfram Research (1996), FromDigits, Wolfram Language function, https://reference.wolfram.com/language/ref/FromDigits.html (updated 2015).

Text

Wolfram Research (1996), FromDigits, Wolfram Language function, https://reference.wolfram.com/language/ref/FromDigits.html (updated 2015).

CMS

Wolfram Language. 1996. "FromDigits." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/FromDigits.html.

APA

Wolfram Language. (1996). FromDigits. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FromDigits.html

BibTeX

@misc{reference.wolfram_2024_fromdigits, author="Wolfram Research", title="{FromDigits}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/FromDigits.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_fromdigits, organization={Wolfram Research}, title={FromDigits}, year={2015}, url={https://reference.wolfram.com/language/ref/FromDigits.html}, note=[Accessed: 22-December-2024 ]}