--- old/src/share/classes/java/lang/Double.java 2012-11-29 17:05:23.244723795 -0800 +++ new/src/share/classes/java/lang/Double.java 2012-11-29 17:05:23.068723786 -0800 @@ -1021,6 +1021,48 @@ 1)); // (0.0, -0.0) or (NaN, !NaN) } + /** + * Adds two {@code double} values together as per the + operator. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Double>} or {@code DoubleBinaryOperator}. + * + * @param a an argument. + * @param b another argument. + * @return the sum of {@code a} and {@code b}. + * @since 1.8 + */ + public static double sum(double a, double b) { + return a + b; + } + + /** + * Returns the greater of two {@code double} values. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Double>} or {@code DoubleBinaryOperator}. + * + * @param a an argument. + * @param b another argument. + * @return the larger of {@code a} and {@code b}. + * @since 1.8 + */ + public static double max(double a, double b) { + return (a >= b) ? a : b; + } + + /** + * Returns the lesser of two {@code double} values. + * Suitable for conversion as a method reference to functional interfaces such + * as {@code BinaryOperator<Double>} or {@code DoubleBinaryOperator}. + * + * @param a an argument. + * @param b another argument. + * @return the lesser of {@code a} and {@code b}. + * @since 1.8 + */ + public static double min(double a, double b) { + return (a <= b) ? a : b; + } + /** use serialVersionUID from JDK 1.0.2 for interoperability */ private static final long serialVersionUID = -9172774392245257468L; }