code: private static boolean isFloat( Number n ) {
        if( n instanceof Float ){
           return true;
        }
        try{
           float f = Float.parseFloat( String.valueOf( n ) );
           return !Float.isInfinite( f );
        }catch( NumberFormatException e ){
           return false;
        }
     }
docs: Finds out if n represents a Float.
  
  @return true if n is instanceOf Float or the literal value can be
  evaluated as a Float.