IntegerLength
The number of digits of in the given base — base 10 by default.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
IntegerLength✓IntegerLength(n)the number of base-10 digits of IntegerLength(n, base)the number of digits in the given baseTyped signatures
| Type | Package | Applies |
|---|---|---|
(integer, integer?) -> integer | numerals | always |
Details
- The sign of is not counted —
IntegerLength(-123)is 3, same asIntegerLength(123) IntegerLength(0)is 0, unlike IntegerDigits's one-element{0}— there is no shortest numeral for 0, only the empty one
Plot
Examples
Possible issues #
About
| Examples | 8 |
|---|---|
| Checked against | Wolfram Language 8 agreemathlib4 6 agree2 error |
| Crosswalk | Wolfram Language |
Implementation
mapped
mathlib4packages/oracle/src/mappings.tsThe length of Nat.digits, which is [] at 0, so 0 has length 0 as ours; natural n only.
mapped
mathlib4packages/oracle/src/mappings.tsAs the one-argument row, in an integer base.
See also: IntegerDigits, IntegerReverse, IntegerString