code: public float nextFloat() {
          // Check cached result
          if ((typeCache != null) && (typeCache instanceof Float)) {
              float val = ((Float)typeCache).floatValue();
              useTypeCache();
              return val;
          }
          setRadix(10);
          clearCaches();
          try {
              return Float.parseFloat(processFloatToken(next(floatPattern())));
          } catch (NumberFormatException nfe) {
              position = matcher.start(); // don't skip bad token
              throw new InputMismatchException(nfe.getMessage());
          }
      }
docs: Scans the next token of the input as a <tt>float</tt>.
  This method will throw <code>InputMismatchException</code>
  if the next token cannot be translated into a valid float value as
  described below. If the translation is successful, the scanner advances
  past the input that matched.
  
  <p> If the next token matches the <a
  href="#Float-regex"><i>Float</i></a> regular expression defined above
  then the token is converted into a <tt>float</tt> value as if by
  removing all locale specific prefixes, group separators, and locale
  specific suffixes, then mapping non-ASCII digits into ASCII
  digits via {@link Character#digit Character.digit}, prepending a
  negative sign (-) if the locale specific negative prefixes and suffixes
  were present, and passing the resulting string to
  {@link Float#parseFloat Float.parseFloat}. If the token matches
  the localized NaN or infinity strings, then either "Nan" or "Infinity"
  is passed to {@link Float#parseFloat(String) Float.parseFloat} as
  appropriate.
  
  @return the <tt>float</tt> scanned from the input
  @throws InputMismatchException
  if the next token does not match the <i>Float</i>
  regular expression, or is out of range
  @throws NoSuchElementException if input is exhausted
  @throws IllegalStateException if this scanner is closed