Returns the number of digits of the specified integer. @param integer number to be checked @return number of digits
(final int integer)
| 434 | * @return number of digits |
| 435 | */ |
| 436 | public static int numDigits(final int integer) { |
| 437 | int d = 1, i = integer; |
| 438 | if(i >= 100000000) { d += 8; i /= 100000000; } |
| 439 | if(i >= 10000) { d += 4; i /= 10000; } |
| 440 | if(i >= 100) { d += 2; i /= 100; } |
| 441 | if(i >= 10) d++; |
| 442 | return d; |
| 443 | } |
| 444 | |
| 445 | /** |
| 446 | * Creates a token representation from the specified long value, |
no outgoing calls
no test coverage detected