MCPcopy Create free account
hub / github.com/ReadyTalk/avian / digit

Method digit

classpath/java/lang/Character.java:93–110  ·  view source on GitHub ↗
(char c, int radix)

Source from the content-addressed store, hash-verified

91 }
92
93 public static int digit(char c, int radix) {
94 int digit = 0;
95 if ((c >= '0') && (c <= '9')) {
96 digit = c - '0';
97 } else if ((c >= 'a') && (c <= 'z')) {
98 digit = c - 'a' + 10;
99 } else if ((c >= 'A') && (c <= 'Z')) {
100 digit = c - 'A' + 10;
101 } else {
102 return -1;
103 }
104
105 if (digit < radix) {
106 return digit;
107 } else {
108 return -1;
109 }
110 }
111
112 public static char forDigit(int digit, int radix) {
113 if (MIN_RADIX <= radix && radix <= MAX_RADIX) {

Callers 3

mainMethod · 0.95
parseLongMethod · 0.95
readUtf16Method · 0.95

Calls

no outgoing calls

Tested by 1

mainMethod · 0.76