code: public static boolean equalsIncludingNaN(float x, float y) {
          return (Float.isNaN(x) && Float.isNaN(y)) || equals(x, y, 1);
      }
docs: Returns true if both arguments are NaN or neither is NaN and they are
  equal as defined by {@link #equals(float,float) equals(x, y, 1)}.
  
  @param x first value
  @param y second value
  @return {@code true} if the values are equal or both are NaN.
  @since 2.2