8188044: We need Math.unsignedMultiplyHigh

Reviewed-by: rriggs, aph, darcy
This commit is contained in:
Brian Burkhalter 2021-07-02 18:15:35 +00:00
parent 3d84398d12
commit ca4bea4665
3 changed files with 81 additions and 10 deletions

View file

@ -982,6 +982,7 @@ public final class StrictMath {
* @param x the first value
* @param y the second value
* @return the result
* @see #unsignedMultiplyHigh
* @see Math#multiplyHigh(long,long)
* @since 9
*/
@ -989,6 +990,21 @@ public final class StrictMath {
return Math.multiplyHigh(x, y);
}
/**
* Returns as a {@code long} the most significant 64 bits of the unsigned
* 128-bit product of two unsigned 64-bit factors.
*
* @param x the first value
* @param y the second value
* @return the result
* @see #multiplyHigh
* @see Math#unsignedMultiplyHigh(long,long)
* @since 18
*/
public static long unsignedMultiplyHigh(long x, long y) {
return Math.unsignedMultiplyHigh(x, y);
}
/**
* Returns the largest (closest to positive infinity)
* {@code int} value that is less than or equal to the algebraic quotient.