< prev index next >

src/java.base/share/classes/java/lang/Float.java

Print this page
rev 52981 : 8215300: additional changes to constants API


 972      */
 973     public static float max(float a, float b) {
 974         return Math.max(a, b);
 975     }
 976 
 977     /**
 978      * Returns the smaller of two {@code float} values
 979      * as if by calling {@link Math#min(float, float) Math.min}.
 980      *
 981      * @param a the first operand
 982      * @param b the second operand
 983      * @return the smaller of {@code a} and {@code b}
 984      * @see java.util.function.BinaryOperator
 985      * @since 1.8
 986      */
 987     public static float min(float a, float b) {
 988         return Math.min(a, b);
 989     }
 990 
 991     /**
 992      * Returns a nominal descriptor for this instance, which is the instance
 993      * itself.
 994      *
 995      * @return an {@link Optional} describing the {@linkplain Float} instance
 996      * @since 12
 997      */
 998     @Override
 999     public Optional<Float> describeConstable() {
1000         return Optional.of(this);
1001     }
1002 
1003     /**
1004      * Resolves this instance as a {@link ConstantDesc}, the result of which is
1005      * the instance itself.
1006      *
1007      * @param lookup ignored
1008      * @return the {@linkplain Float} instance
1009      * @since 12
1010      */
1011     @Override
1012     public Float resolveConstantDesc(MethodHandles.Lookup lookup) {
1013         return this;


 972      */
 973     public static float max(float a, float b) {
 974         return Math.max(a, b);
 975     }
 976 
 977     /**
 978      * Returns the smaller of two {@code float} values
 979      * as if by calling {@link Math#min(float, float) Math.min}.
 980      *
 981      * @param a the first operand
 982      * @param b the second operand
 983      * @return the smaller of {@code a} and {@code b}
 984      * @see java.util.function.BinaryOperator
 985      * @since 1.8
 986      */
 987     public static float min(float a, float b) {
 988         return Math.min(a, b);
 989     }
 990 
 991     /**
 992      * Returns an {@link Optional} containing the nominal descriptor for this
 993      * instance, which is the instance itself.
 994      *
 995      * @return an {@link Optional} describing the {@linkplain Float} instance
 996      * @since 12
 997      */
 998     @Override
 999     public Optional<Float> describeConstable() {
1000         return Optional.of(this);
1001     }
1002 
1003     /**
1004      * Resolves this instance as a {@link ConstantDesc}, the result of which is
1005      * the instance itself.
1006      *
1007      * @param lookup ignored
1008      * @return the {@linkplain Float} instance
1009      * @since 12
1010      */
1011     @Override
1012     public Float resolveConstantDesc(MethodHandles.Lookup lookup) {
1013         return this;
< prev index next >