Searched refs:radix (Results 1 - 13 of 13) sorted by relevance

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
H A DBigIntegerToStringTest.java29 * Method: toString(int radix)
33 * If 36 < radix < 2 it should be set to 10
37 int radix = 10;
38 BigInteger aNumber = new BigInteger(value, radix);
44 * test negative number of radix 2
48 int radix = 2;
49 BigInteger aNumber = new BigInteger(value, radix);
50 String result = aNumber.toString(radix);
55 * test positive number of radix 2
59 int radix
[all...]
H A DBigIntegerConstructorsTest.java30 * BigInteger(String val, int radix)
571 * Create a number from a string value and radix.
572 * Verify an exception thrown if a radix is out of range
576 int radix = 45;
578 new BigInteger(value, radix);
585 * Create a number from a string value and radix.
590 int radix = 10;
592 new BigInteger(value, radix);
599 * Create a number from a string value and radix.
604 int radix
[all...]
/libcore/luni/src/main/java/java/lang/
H A DInteger.java339 * radix. The ASCII characters \u002d ('-') and \u002b ('+') are recognized
344 * @param radix
345 * the radix to use when parsing.
347 * {@code radix}.
350 * or {@code radix < Character.MIN_RADIX ||
351 * radix > Character.MAX_RADIX}.
353 public static int parseInt(String string, int radix) throws NumberFormatException { argument
354 if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
355 throw new NumberFormatException("Invalid radix
393 parsePositiveInt(String string, int radix) argument
403 parse(String string, int offset, int radix, boolean negative) argument
509 toString(int i, int radix) argument
544 valueOf(String string, int radix) argument
[all...]
H A DLong.java326 * radix. The ASCII characters \u002d ('-') and \u002b ('+') are recognized
331 * @param radix
332 * the radix to use when parsing.
334 * {@code radix}.
337 * {@code radix < Character.MIN_RADIX ||
338 * radix > Character.MAX_RADIX}.
340 public static long parseLong(String string, int radix) throws NumberFormatException { argument
341 if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
342 throw new NumberFormatException("Invalid radix
356 parse(String string, int offset, int radix, boolean negative) argument
406 parsePositiveLong(String string, int radix) argument
495 toString(long v, int radix) argument
530 valueOf(String string, int radix) argument
[all...]
H A DIntegralToString.java102 * The digits for every supported radix.
122 * Equivalent to Integer.toString(i, radix).
124 public static String intToString(int i, int radix) { argument
125 if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
126 radix = 10;
128 if (radix == 10) {
145 int bufLen = radix < 8 ? 33 : 12; // Max chars in result (conservative)
150 int q = i / radix;
151 buf[--cursor] = DIGITS[radix *
253 longToString(long v, int radix) argument
[all...]
H A DByte.java199 * radix. The ASCII character \u002d ('-') is recognized as the minus sign.
203 * @param radix
204 * the radix to use when parsing.
206 * {@code radix}.
209 * {@code radix < Character.MIN_RADIX ||
210 * radix > Character.MAX_RADIX}.
212 public static byte parseByte(String string, int radix) throws NumberFormatException { argument
213 int intValue = Integer.parseInt(string, radix);
268 * radix.
272 * @param radix
282 valueOf(String string, int radix) argument
[all...]
H A DShort.java198 * radix. The ASCII character \u002d ('-') is recognized as the minus sign.
202 * @param radix
203 * the radix to use when parsing.
205 * {@code radix}.
208 * {@code radix < Character.MIN_RADIX ||
209 * radix > Character.MAX_RADIX}.
211 public static short parseShort(String string, int radix) throws NumberFormatException { argument
212 int intValue = Integer.parseInt(string, radix);
237 * specified short value with radix 10.
264 * radix
278 valueOf(String string, int radix) argument
[all...]
H A DCharacter.java116 * The minimum radix used for conversions between characters and integers.
121 * The maximum radix used for conversions between characters and integers.
2312 * {@code c} in the supplied radix. The value of {@code radix} must be
2317 * @param radix
2318 * the radix.
2319 * @return the value of {@code c} in {@code radix} if {@code radix} lies
2322 public static int digit(char c, int radix) { argument
2323 return digit((int) c, radix);
2339 digit(int codePoint, int radix) argument
2358 digitImpl(int codePoint, int radix) argument
2389 forDigit(int digit, int radix) argument
[all...]
/libcore/luni/src/main/java/java/util/
H A DScanner.java608 * {@code BigInteger} in the default radix.
621 * {@code BigInteger} in the specified radix.
623 * @param radix
624 * the radix used to translate the token into a
631 public boolean hasNextBigInteger(int radix) { argument
632 Pattern integerPattern = getIntegerPattern(radix);
638 cachedNextValue = new BigInteger(intString, radix);
662 * {@code byte} value in the default radix.
675 * {@code byte} value in the specified radix.
677 * @param radix
685 hasNextByte(int radix) argument
777 hasNextInt(int radix) argument
831 hasNextLong(int radix) argument
872 hasNextShort(int radix) argument
1081 nextBigInteger(int radix) argument
1159 nextByte(int radix) argument
1309 nextInt(int radix) argument
1421 nextLong(int radix) argument
1483 nextShort(int radix) argument
1510 public int radix() { method in class:Scanner
1637 useRadix(int radix) argument
1643 checkRadix(int radix) argument
1722 getIntegerPattern(int radix) argument
[all...]
/libcore/luni/src/main/java/java/math/
H A DConversion.java30 * Holds the maximal exponent for each radix, so that radix<sup>digitFitInInt[radix]</sup>
53 static String bigInteger2String(BigInteger val, int radix) { argument
68 return Long.toString(v, radix);
70 if ((radix == 10) || (radix < Character.MIN_RADIX)
71 || (radix > Character.MAX_RADIX)) {
75 bitsForRadixDigit = Math.log(radix) / Math.log(2);
82 if (radix !
[all...]
H A DBigInteger.java224 * followed by a non-empty sequence of digits in the specified radix. Digits
225 * are interpreted as if by {@code Character.digit(char, radix)}.
228 * @param radix the base to be used for the conversion.
231 * representation of a {@code BigInteger} or if {@code radix <
232 * Character.MIN_RADIX} or {@code radix > Character.MAX_RADIX}.
234 public BigInteger(String value, int radix) { argument
238 if (radix == 10) {
242 } else if (radix == 16) {
247 if (radix < Character.MIN_RADIX || radix > Characte
868 toString(int radix) argument
1158 parseFromString(BigInteger bi, String value, int radix) argument
[all...]
/libcore/luni/src/main/native/
H A Djava_lang_Character.cpp28 static jint Character_digitImpl(JNIEnv*, jclass, jint codePoint, jint radix) { argument
29 return u_digit(codePoint, radix);
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
H A DScannerTest.java474 * @tests java.util.Scanner#radix()
478 assertEquals(10, s.radix());
497 assertEquals(11, s.radix());
944 // If the radix is different from 10
1089 // If the parameter radix is illegal, the following test cases fail on
1117 // If the radix is different from 10
1283 // If the radix is different from 10
1358 // If the radix is different from 10
1527 // If the radix is different from 10
1654 // If the radix i
[all...]

Completed in 310 milliseconds