Home
last modified time | relevance | path

Searched refs:radix (Results 1 – 25 of 33) sorted by relevance

12

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DBigIntegerToStringTest.java37 int radix = 10; in testRadixOutOfRange() local
38 BigInteger aNumber = new BigInteger(value, radix); in testRadixOutOfRange()
48 int radix = 2; in testRadix2Neg() local
49 BigInteger aNumber = new BigInteger(value, radix); in testRadix2Neg()
50 String result = aNumber.toString(radix); in testRadix2Neg()
59 int radix = 2; in testRadix2Pos() local
60 BigInteger aNumber = new BigInteger(value, radix); in testRadix2Pos()
61 String result = aNumber.toString(radix); in testRadix2Pos()
70 int radix = 16; in testRadix10Neg() local
71 BigInteger aNumber = new BigInteger(value, radix); in testRadix10Neg()
[all …]
DBigIntegerConstructorsTest.java576 int radix = 45; in testConstructorStringException1() local
578 new BigInteger(value, radix); in testConstructorStringException1()
590 int radix = 10; in testConstructorStringException2() local
592 new BigInteger(value, radix); in testConstructorStringException2()
604 int radix = 34; in testConstructorStringException3() local
606 new BigInteger(value, radix); in testConstructorStringException3()
618 int radix = 20; in testConstructorStringException4() local
620 new BigInteger(value, radix); in testConstructorStringException4()
631 int radix = 2; in testConstructorStringRadix2() local
633 BigInteger aNumber = new BigInteger(value, radix); in testConstructorStringRadix2()
[all …]
/libcore/ojluni/src/main/java/java/lang/
DInteger.java156 public static String toString(int i, int radix) { in toString() argument
157 if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) in toString()
158 radix = 10; in toString()
161 if (radix == 10) { in toString()
177 while (i <= -radix) { in toString()
178 buf[charPos--] = (byte)digits[-(i % radix)]; in toString()
179 i = i / radix; in toString()
245 public static String toUnsignedString(int i, int radix) { in toUnsignedString() argument
246 return Long.toUnsignedString(toUnsignedLong(i), radix); in toUnsignedString()
409 int radix = 1 << shift; in formatUnsignedInt() local
[all …]
DLong.java142 public static String toString(long i, int radix) { in toString() argument
143 if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) in toString()
144 radix = 10; in toString()
145 if (radix == 10) in toString()
160 while (i <= -radix) { in toString()
161 buf[charPos--] = (byte)Integer.digits[(int)(-(i % radix))]; in toString()
162 i = i / radix; in toString()
226 public static String toUnsignedString(long i, int radix) { in toUnsignedString() argument
228 return toString(i, radix); in toUnsignedString()
230 return switch (radix) { in toUnsignedString()
[all …]
DNumberFormatException.java63 static NumberFormatException forInputString(String s, int radix) { in forInputString() argument
65 (radix == 10 ? in forInputString()
67 " under radix " + radix)); in forInputString()
DShort.java138 public static short parseShort(String s, int radix) in parseShort() argument
140 int i = Integer.parseInt(s, radix); in parseShort()
143 "Value out of range. Value:\"" + s + "\" Radix:" + radix); in parseShort()
194 public static Short valueOf(String s, int radix) in valueOf() argument
196 return valueOf(parseShort(s, radix)); in valueOf()
DByte.java198 public static byte parseByte(String s, int radix) in parseByte() argument
200 int i = Integer.parseInt(s, radix); in parseByte()
203 "Value out of range. Value:\"" + s + "\" Radix:" + radix); in parseByte()
254 public static Byte valueOf(String s, int radix) in valueOf() argument
256 return valueOf(parseByte(s, radix)); in valueOf()
/libcore/ojluni/src/test/java/lang/Long/
DUnsigned.java200 for(int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; radix++) { in testToStringUnsigned()
202 String result1 = Long.toUnsignedString(datum, radix); in testToStringUnsigned()
203 String result2 = toUnsignedBigInt(datum).toString(radix); in testToStringUnsigned()
211 if (radix == 10) { in testToStringUnsigned()
220 long parseResult = Long.parseUnsignedLong(result1, radix); in testToStringUnsigned()
227 datum, radix, result1, parseResult)); in testToStringUnsigned()
257 for(int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; radix++) { in testParseUnsignedLong()
258 String bigString = value.toString(radix); in testParseUnsignedLong()
259 long longResult = Long.parseUnsignedLong(bigString, radix); in testParseUnsignedLong()
266 value, radix, bigString, longResult)); in testParseUnsignedLong()
[all …]
DParsingTest.java134 private static void checkNumberFormatException(String val, int start, int end, int radix) { in checkNumberFormatException() argument
139 n = Long_parseLong(val, start, end, radix); in checkNumberFormatException()
140 System.err.println("parseLong(" + val + ", " + start + ", " + end + ", " + radix + in checkNumberFormatException()
148 private static void checkIndexOutOfBoundsException(String val, int start, int end, int radix) { in checkIndexOutOfBoundsException() argument
153 n = Long_parseLong(val, start, end, radix); in checkIndexOutOfBoundsException()
154 System.err.println("parseLong(" + val + ", " + start + ", " + end + ", " + radix + in checkIndexOutOfBoundsException()
162 private static void checkNull(int start, int end, int radix) { in checkNull() argument
167 n = Long_parseLong(null, start, end, radix); in checkNull()
168 System.err.println("parseLong(null, " + start + ", " + end + ", " + radix + in checkNull()
176 private static void check(long expected, String val, int start, int end, int radix) { in check() argument
[all …]
/libcore/ojluni/src/test/java/lang/Integer/
DParsingTest.java142 private static void checkNumberFormatException(String val, int start, int end, int radix) { in checkNumberFormatException() argument
147 n = Integer_parseInt(val, start, end, radix); in checkNumberFormatException()
148 System.err.println("parseInt(" + val + ", " + start + ", " + end + ", " + radix + in checkNumberFormatException()
156 private static void checkIndexOutOfBoundsException(String val, int start, int end, int radix) { in checkIndexOutOfBoundsException() argument
161 n = Integer_parseInt(val, start, end, radix); in checkIndexOutOfBoundsException()
162 System.err.println("parseInt(" + val + ", " + start + ", " + end + ", " + radix + in checkIndexOutOfBoundsException()
170 private static void checkNull(int start, int end, int radix) { in checkNull() argument
175 n = Integer_parseInt(null, start, end, radix); in checkNull()
176 System.err.println("parseInt(null, " + start + ", " + end + ", " + radix + in checkNull()
184 private static void check(int expected, String val, int start, int end, int radix) { in check() argument
[all …]
DUnsigned.java201 for(int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; radix++) { in testToStringUnsigned()
203 String result1 = Integer.toUnsignedString(datum, radix); in testToStringUnsigned()
204 String result2 = Long.toString(Integer.toUnsignedLong(datum), radix); in testToStringUnsigned()
212 if (radix == 10) { in testToStringUnsigned()
221 int parseResult = Integer.parseUnsignedInt(result1, radix); in testToStringUnsigned()
226 datum, radix, result1, parseResult)); in testToStringUnsigned()
251 for(int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; radix++) { in testParseUnsignedInt()
252 String longString = Long.toString(value, radix); in testParseUnsignedInt()
253 int intResult = Integer.parseUnsignedInt(longString, radix); in testParseUnsignedInt()
258 value, radix, longString, intResult)); in testParseUnsignedInt()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/
DIntegerTest.java202 for (int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; ++radix) { in testParseUnsignedInt()
205 Integer.parseUnsignedInt(Integer.toUnsignedString(value, radix), radix)); in testParseUnsignedInt()
223 for (int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; ++radix) { in testParseUnsignedInt()
224 final int r = radix; in testParseUnsignedInt()
268 for (int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; ++radix) { in testParseUnsignedIntSubstring()
269 String arb = leftPad + Integer.toUnsignedString(value, radix) + rightPad; in testParseUnsignedIntSubstring()
271 value, Integer.parseUnsignedInt(arb, i, arb.length() - j, radix)); in testParseUnsignedIntSubstring()
301 for (int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; ++radix) { in testParseUnsignedIntSubstring()
302 final int r = radix; in testParseUnsignedIntSubstring()
304 leftPad + Long.toUnsignedString(large_value, radix) + rightPad; in testParseUnsignedIntSubstring()
[all …]
DLongTest.java222 for(int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; ++radix) {
224 Long.parseUnsignedLong(Long.toUnsignedString(val, radix), radix));
261 for(int radix = Character.MIN_RADIX; radix <= Character.MAX_RADIX; ++radix) {
266 assertTrue(Long.toUnsignedString(val, radix).equals(b.toString(radix)));
/libcore/ojluni/src/main/java/java/util/
DScanner.java359 private int radix = 10; field in Scanner
424 String radixDigits = digits.substring(0, radix); in buildIntegerPatternString()
436 String non0RadixDigits = "((?i)[" + digits.substring(1, radix) + "]|(" + non0Digit + "))"; in buildIntegerPatternString()
1348 public int radix() { in radix() method in Scanner
1370 public Scanner useRadix(int radix) { in useRadix() argument
1371 if ((radix < Character.MIN_RADIX) || (radix > Character.MAX_RADIX)) in useRadix()
1372 throw new IllegalArgumentException("radix:"+radix); in useRadix()
1374 if (this.defaultRadix == radix) in useRadix()
1377 this.defaultRadix = radix; in useRadix()
1385 private void setRadix(int radix) { in setRadix() argument
[all …]
/libcore/ojluni/annotations/sdk/nullability/java/lang/
DInteger.annotated.java38 @libcore.util.NonNull public static java.lang.String toString(int i, int radix) { throw new Runtime… in toString() argument
40 @libcore.util.NonNull public static java.lang.String toUnsignedString(int i, int radix) { throw new… in toUnsignedString() argument
52 public static int parseInt(@libcore.util.NonNull java.lang.String s, int radix) throws java.lang.Nu… in parseInt() argument
56 ….util.NonNull java.lang.CharSequence s, int beginIndex, int endIndex, int radix) throws java.lang.… in parseInt() argument
58 public static int parseUnsignedInt(@libcore.util.NonNull java.lang.String s, int radix) throws java… in parseUnsignedInt() argument
62 ….util.NonNull java.lang.CharSequence s, int beginIndex, int endIndex, int radix) throws java.lang.… in parseUnsignedInt() argument
64 …c java.lang.Integer valueOf(@libcore.util.NonNull java.lang.String s, int radix) throws java.lang.… in valueOf() argument
DLong.annotated.java39 @libcore.util.NonNull public static java.lang.String toString(long i, int radix) { throw new Runtim… in toString() argument
41 @libcore.util.NonNull public static java.lang.String toUnsignedString(long i, int radix) { throw ne… in toUnsignedString() argument
53 public static long parseLong(@libcore.util.NonNull java.lang.String s, int radix) throws java.lang.… in parseLong() argument
57 ….util.NonNull java.lang.CharSequence s, int beginIndex, int endIndex, int radix) throws java.lang.… in parseLong() argument
59 public static long parseUnsignedLong(@libcore.util.NonNull java.lang.String s, int radix) throws ja… in parseUnsignedLong() argument
63 ….util.NonNull java.lang.CharSequence s, int beginIndex, int endIndex, int radix) throws java.lang.… in parseUnsignedLong() argument
65 …atic java.lang.Long valueOf(@libcore.util.NonNull java.lang.String s, int radix) throws java.lang.… in valueOf() argument
DByte.annotated.java41 public static byte parseByte(@libcore.util.NonNull java.lang.String s, int radix) throws java.lang.… in parseByte() argument
45 …atic java.lang.Byte valueOf(@libcore.util.NonNull java.lang.String s, int radix) throws java.lang.… in valueOf() argument
/libcore/ojluni/annotations/hiddenapi/java/lang/
DLong.java43 public static java.lang.String toString(long i, int radix) { in toString() argument
47 public static java.lang.String toUnsignedString(long i, int radix) { in toUnsignedString() argument
91 public static long parseLong(java.lang.String s, int radix) in parseLong() argument
100 public static long parseUnsignedLong(java.lang.String s, int radix) in parseUnsignedLong() argument
110 public static java.lang.Long valueOf(java.lang.String s, int radix) in valueOf() argument
DInteger.java44 public static java.lang.String toString(int i, int radix) { in toString() argument
48 public static java.lang.String toUnsignedString(int i, int radix) { in toUnsignedString() argument
88 public static int parseInt(java.lang.String s, int radix) in parseInt() argument
97 public static int parseUnsignedInt(java.lang.String s, int radix) in parseUnsignedInt() argument
106 public static java.lang.Integer valueOf(java.lang.String s, int radix) in valueOf() argument
DShort.java46 public static short parseShort(java.lang.String s, int radix) in parseShort() argument
55 public static java.lang.Short valueOf(java.lang.String s, int radix) in valueOf() argument
DByte.java50 public static byte parseByte(java.lang.String s, int radix) in parseByte() argument
59 public static java.lang.Byte valueOf(java.lang.String s, int radix) in valueOf() argument
/libcore/luni/src/test/java/libcore/java/util/
DScannerTest.java38 assertEquals(8, scanner.radix()); in testReset()
43 assertEquals(10, scanner.radix()); in testReset()
/libcore/ojluni/src/main/java/java/math/
DBigInteger.java480 public BigInteger(String val, int radix) { in BigInteger() argument
484 if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) in BigInteger()
510 Character.digit(val.charAt(cursor), radix) == 0) { in BigInteger()
525 long numBits = ((numDigits * bitsPerDigit[radix]) >>> 10) + 1; in BigInteger()
533 int firstGroupLen = numDigits % digitsPerInt[radix]; in BigInteger()
535 firstGroupLen = digitsPerInt[radix]; in BigInteger()
537 magnitude[numWords - 1] = Integer.parseInt(group, radix); in BigInteger()
542 int superRadix = intRadix[radix]; in BigInteger()
545 group = val.substring(cursor, cursor += digitsPerInt[radix]); in BigInteger()
546 groupVal = Integer.parseInt(group, radix); in BigInteger()
[all …]
/libcore/ojluni/src/test/java/math/BigInteger/
DBigIntegerTest.java661 for (int radix=Character.MIN_RADIX; radix < Character.MAX_RADIX; radix++) { in stringConv_generic()
662 String result = x.toString(radix); in stringConv_generic()
663 BigInteger test = new BigInteger(result, radix); in stringConv_generic()
665 "BigInteger toString: "+x+" Test: "+test+" radix: " + radix); in stringConv_generic()
681 for (int radix = Character.MIN_RADIX; radix < Character.MAX_RADIX; radix++) { in stringConv_schoenhage()
682 String result = x.toString(radix); in stringConv_schoenhage()
683 BigInteger test = new BigInteger(result, radix); in stringConv_schoenhage()
685 "BigInteger toString: "+x+" Test: "+test+" radix: " + radix); in stringConv_schoenhage()
/libcore/ojluni/src/main/native/
DCharacter.cpp102 Character_digitImpl(JNIEnv* env, jclass, jint codePoint, jint radix) { in Character_digitImpl() argument
103 return u_digit(codePoint, radix); in Character_digitImpl()

12