code: private void scanNumber(int pos, int radix) {
          // for octal, allow base-10 digit in case it's a float literal
          this.radix = radix;
          int digitRadix = (radix == 8 ? 10 : radix);
          int firstDigit = reader.digit(pos, Math.max(10, digitRadix));
          boolean seendigit = firstDigit >= 0;
          boolean seenValidDigit = firstDigit >= 0 && firstDigit < digitRadix;
          if (seendigit) {
              scanDigits(pos, digitRadix);
          }
          if (radix == 16 && reader.ch == '.') {
              scanHexFractionAndSuffix(pos, seendigit);
          } else if (seendigit && radix == 16 && (reader.ch == 'p' || reader.ch == 'P')) {
              scanHexExponentAndSuffix(pos);
          } else if (digitRadix == 10 && reader.ch == '.') {
              reader.putChar(true);
              scanFractionAndSuffix(pos);
          } else if (digitRadix == 10 &&
                     (reader.ch == 'e' || reader.ch == 'E' ||
                      reader.ch == 'f' || reader.ch == 'F' ||
                      reader.ch == 'd' || reader.ch == 'D')) {
              scanFractionAndSuffix(pos);
          } else {
              if (!seenValidDigit) {
                  switch (radix) {
                  case 2:
                      lexError(pos, "invalid.binary.number");
                      break;
                  case 16:
                      lexError(pos, "invalid.hex.number");
                      break;
                  }
              }
              if (reader.ch == 'l' || reader.ch == 'L') {
                  reader.scanChar();
                  tk = TokenKind.LONGLITERAL;
              } else {
                  tk = TokenKind.INTLITERAL;
              }
          }
      }
docs: Read a number.
  @param radix  The radix of the number; one of 2, 8, 10, 16.