public class Numbers extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static int[] |
imArr |
protected static int[] |
islArr
Integer array for integer string length binary search.
|
protected static long[] |
lmArr |
protected static long[] |
lslArr
Long array for long string length binary search.
|
| Constructor and Description |
|---|
Numbers() |
| Modifier and Type | Method and Description |
|---|---|
static int |
divu10gcc(int n)
Divu10 from GNU GCC.
|
static int |
divu10hd(int n)
Divu10 from Hackers Delight.
|
static int |
intModulo(int i,
int digits) |
static int |
intStrLen(int i)
Find the string length of the integer without leading zeroes.
|
static int |
intTrailingZeros(int i)
Returns the number of trailing zeroes in an integer, or zero if the number is 0.
|
static long |
longModulo(long l,
int digits) |
static int |
longStrLen(long l)
Find the string length of the long without leading zeroes.
|
protected static int[] islArr
protected static long[] lslArr
protected static int[] imArr
protected static long[] lmArr
public Numbers()
public static int intStrLen(int i)
i - integer valuepublic static int longStrLen(long l)
l - long valuepublic static int intTrailingZeros(int i)
i - number to count trailing zeroes inpublic static int intModulo(int i, int digits)
public static long longModulo(long l, int digits)
public static int divu10hd(int n)
n - integer to divide by 10public static int divu10gcc(int n)
n - integer to divide by 10Copyright © 2011–2023. All rights reserved.