IntegerLength
gives the number of digits in the base 10 representation of the integer n.
IntegerLength[n,b]
gives the number of digits in the base b representation of n.
Details
- Integer mathematical function, suitable for both symbolic and numerical manipulation.
- IntegerLength[n,b] is effectively an efficient version of Floor[Log[b,n]]+1.
- IntegerLength ignores the sign of n.
- IntegerLength automatically threads over lists.
Examples
open allclose allBasic Examples (4)
Find the number of decimal digits in 123456789:
The number of binary digits in :
The IntegerLength for different bases:
Wolfram Research (2007), IntegerLength, Wolfram Language function, https://reference.wolfram.com/language/ref/IntegerLength.html.
Text
Wolfram Research (2007), IntegerLength, Wolfram Language function, https://reference.wolfram.com/language/ref/IntegerLength.html.
CMS
Wolfram Language. 2007. "IntegerLength." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IntegerLength.html.
APA
Wolfram Language. (2007). IntegerLength. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IntegerLength.html