public final class NumberTheory extends Object
Constructor and Description |
---|
NumberTheory() |
Modifier and Type | Method and Description |
---|---|
static double |
convOthBase2Decimal(String numberLiteral,
int numeralSystemBase)
Other base (base between 1 and 36) number literal conversion to decimal
number.
|
static int |
digitIndex(char digitChar)
Digit index based on digit character for numeral systems with base between 1
and 36.
|
static double |
max(double a,
double b) |
static double |
primeTest(double n)
Prime test
|
static boolean |
primeTest(long n)
Prime test
|
public static final double max(double a, double b)
public static final boolean primeTest(long n)
n
- The number to be tested.public static final double primeTest(double n)
n
- The number to be tested.public static final int digitIndex(char digitChar)
digitChar
- Digit character (lower or upper case) representing digit in
numeral systems with base between 1 and 36. Digits: 0:0, 1:1, 2:2,
3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:A, 11:B, 12:C, 13:D, 14:E,
15:F, 16:G, 17:H, 18:I, 19:J, 20:K, 21:L, 22:M, 23:N, 24:O, 25:P,
26:Q, 27:R, 28:S, 29:T, 30:U, 31:V, 32:W, 33:X, 34:Y, 35:Zpublic static final double convOthBase2Decimal(String numberLiteral, int numeralSystemBase)
numberLiteral
- Number literal in given numeral system with base between 1 and 36.
Digits: 0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:A,
11:B, 12:C, 13:D, 14:E, 15:F, 16:G, 17:H, 18:I, 19:J, 20:K, 21:L,
22:M, 23:N, 24:O, 25:P, 26:Q, 27:R, 28:S, 29:T, 30:U, 31:V, 32:W,
33:X, 34:Y, 35:ZnumeralSystemBase
- Numeral system base, between 1 and 36