NumberExpandCopy to clipboard.
✖
NumberExpand
gives a list of the decimal digits of x multiplied by their corresponding powers of 10.
Details

- For any number x, Total[NumberExpand[x,…]]==x.
- For an integer x, NumberExpand[x] returns a list of integers.
- For a rational x, the fractional part of x is added to the last element of NumberExpand[IntegerPart[x]].
- For a non-exact number x, all elements of NumberExpand[x] but the last are exact.
- For an exact number x, the length of NumberExpand[x] equals the number of digits in the integer part of x.
- For a non-exact number x, NumberExpand[x] normally returns a list of length Round[Precision[x]].
- For a non-exact number x and an exact base b, NumberExpand[x,b] normally returns a list of length Round[Precision[x] Log[b,10]].
- If len is larger than Precision[x] Log[b,10], the remaining parts of the expansion are filled in as Indeterminate.
- The base b in NumberExpand[x,b] can be a real number greater than 1.
- For any number x of absolute value less than 1, the first element of NumberExpand[x,…] is 0 or 0..
- NumberExpand[0.] returns a list of length Floor[Accuracy[0.]]+2.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Expand a number into a list of multiples of powers of 10:

https://wolfram.com/xid/0tz4egn2-xljav7


https://wolfram.com/xid/0tz4egn2-mcnlkt


https://wolfram.com/xid/0tz4egn2-sk5vpx


https://wolfram.com/xid/0tz4egn2-rhld82

Specify the length of the output:

https://wolfram.com/xid/0tz4egn2-8k1ja


https://wolfram.com/xid/0tz4egn2-mrygln

Scope (5)Survey of the scope of standard use cases
Expand an integer into a list of multiples of powers of 10:

https://wolfram.com/xid/0tz4egn2-9hy3e5


https://wolfram.com/xid/0tz4egn2-f2tvyv

Expand a rational number in base 2, obtaining a rational remaining part:

https://wolfram.com/xid/0tz4egn2-7zyx4a


https://wolfram.com/xid/0tz4egn2-mf2wl5

Expand a machine-precision real number, obtaining a machine-precision remaining part:

https://wolfram.com/xid/0tz4egn2-6qdotn


https://wolfram.com/xid/0tz4egn2-0wy1i5

Expand an exact complex number in base 7:

https://wolfram.com/xid/0tz4egn2-cdqgzp


https://wolfram.com/xid/0tz4egn2-j9hsr

Expand an inexact complex number in base 10:

https://wolfram.com/xid/0tz4egn2-eq2f3m


https://wolfram.com/xid/0tz4egn2-gqljid

Generalizations & Extensions (5)Generalized and extended use cases

https://wolfram.com/xid/0tz4egn2-jigwdx


https://wolfram.com/xid/0tz4egn2-hjmak3

Expand a real number in a rational base:

https://wolfram.com/xid/0tz4egn2-0372yk


https://wolfram.com/xid/0tz4egn2-ud02ke

Expand a number using a machine-precision base:

https://wolfram.com/xid/0tz4egn2-rpjzqd


https://wolfram.com/xid/0tz4egn2-1xuyq0

Expand a rational number in a real base:

https://wolfram.com/xid/0tz4egn2-bdugf5


https://wolfram.com/xid/0tz4egn2-eix3gr


Expand a real number in a real base:

https://wolfram.com/xid/0tz4egn2-67ep4


https://wolfram.com/xid/0tz4egn2-gxxfdn

Properties & Relations (9)Properties of the function, and connections to other functions
For an integer, when the length of the output is required to be larger than needed, NumberExpand pads with 0s on the right:

https://wolfram.com/xid/0tz4egn2-rv1e4f

For a rational number with a finite-length decimal part, when the length of the output is required to be larger than needed, NumberExpand pads with 0s on the right:

https://wolfram.com/xid/0tz4egn2-lx8hui

For a rational number with an infinite-length decimal part, the last element of the output list is always nonzero:

https://wolfram.com/xid/0tz4egn2-e1t756


https://wolfram.com/xid/0tz4egn2-kq59vg

For any number n, Total[NumberExpand[n,…]] equals n:

https://wolfram.com/xid/0tz4egn2-yraw1


https://wolfram.com/xid/0tz4egn2-h8kde3

The total of the expansion of an exact number in an integer base is the number itself:

https://wolfram.com/xid/0tz4egn2-jrbfrl


https://wolfram.com/xid/0tz4egn2-4e1mp4

If the base is non-exact, the total will have a different precision:

https://wolfram.com/xid/0tz4egn2-fhqmj0


https://wolfram.com/xid/0tz4egn2-hjbvam

For an exact number expanded into inexact parts, the difference with the total is smaller than the last part of the expansion:

https://wolfram.com/xid/0tz4egn2-exdclk


https://wolfram.com/xid/0tz4egn2-j89ewf


https://wolfram.com/xid/0tz4egn2-fk0n5k

Then Rationalize may be able to recover the original exact number:

https://wolfram.com/xid/0tz4egn2-epbb3f

When a non-exact number is expanded in an exact base, all the elements of the output list but the last are exact:

https://wolfram.com/xid/0tz4egn2-qvyd5

The last element is not necessarily zero:

https://wolfram.com/xid/0tz4egn2-gihx9y

For non-exact numbers, NumberExpand returns a list of parts corresponding to the digits of RealDigits:

https://wolfram.com/xid/0tz4egn2-9d134


https://wolfram.com/xid/0tz4egn2-bxz2jl

Small variations of the input may result in representations containing multiple 9s:

https://wolfram.com/xid/0tz4egn2-byv5lf


https://wolfram.com/xid/0tz4egn2-dmqspr

The precision of Total[NumberExpand[…]] is effectively determined by the minimum precision of the input arguments:

https://wolfram.com/xid/0tz4egn2-curs3p


https://wolfram.com/xid/0tz4egn2-calbxc


https://wolfram.com/xid/0tz4egn2-jf1cac


https://wolfram.com/xid/0tz4egn2-mcg0q

NumberExpand automatically threads over lists:

https://wolfram.com/xid/0tz4egn2-ebacq

Possible Issues (1)Common pitfalls and unexpected behavior
Parts of the expansion unknown at the available precision are filled in as Indeterminate:

https://wolfram.com/xid/0tz4egn2-f2xkx


https://wolfram.com/xid/0tz4egn2-d67iwp

In this situation, the original number cannot be reconstructed:

https://wolfram.com/xid/0tz4egn2-b7e2iu

Wolfram Research (2016), NumberExpand, Wolfram Language function, https://reference.wolfram.com/language/ref/NumberExpand.html.
Text
Wolfram Research (2016), NumberExpand, Wolfram Language function, https://reference.wolfram.com/language/ref/NumberExpand.html.
Wolfram Research (2016), NumberExpand, Wolfram Language function, https://reference.wolfram.com/language/ref/NumberExpand.html.
CMS
Wolfram Language. 2016. "NumberExpand." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NumberExpand.html.
Wolfram Language. 2016. "NumberExpand." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NumberExpand.html.
APA
Wolfram Language. (2016). NumberExpand. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NumberExpand.html
Wolfram Language. (2016). NumberExpand. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NumberExpand.html
BibTeX
@misc{reference.wolfram_2025_numberexpand, author="Wolfram Research", title="{NumberExpand}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/NumberExpand.html}", note=[Accessed: 13-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_numberexpand, organization={Wolfram Research}, title={NumberExpand}, year={2016}, url={https://reference.wolfram.com/language/ref/NumberExpand.html}, note=[Accessed: 13-April-2025
]}