This commit is contained in:
Gilles Sadowski 2021-10-17 15:27:45 +02:00
parent e052d9dc53
commit 142dcaa921
1 changed files with 147 additions and 1 deletions

View File

@ -398,6 +398,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return abs(x).
*
* @see Math#abs(int)
*/
public static int abs(int x) {
return ABS_INT.applyAsInt(x);
@ -406,6 +408,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return abs(x).
*
* @see Math#abs(long)
*/
public static long abs(long x) {
return ABS_LONG.applyAsLong(x);
@ -414,6 +418,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return abs(x).
*
* @see Math#abs(float)
*/
public static float abs(float x) {
return ABS_FLOAT.applyAsFloat(x);
@ -422,6 +428,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return abs(x).
*
* @see Math#abs(double)
*/
public static double abs(double x) {
return ABS_DOUBLE.applyAsDouble(x);
@ -430,6 +438,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return acos(x).
*
* @see Math#acos(double)
*/
public static double acos(double x) {
return ACOS.applyAsDouble(x);
@ -447,6 +457,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return addExact(x, y).
*
* @see Math#addExact(int,int)
*/
public static int addExact(int x,
int y) {
@ -457,6 +469,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return addExact(x, y).
*
* @see Math#addExact(long,long)
*/
public static long addExact(long x,
long y) {
@ -466,6 +480,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return asin(x).
*
* @see Math#asin(double)
*/
public static double asin(double x) {
return ASIN.applyAsDouble(x);
@ -481,7 +497,9 @@ public final class JdkMath {
/**
* @param x Number.
* @return asin(x).
* @return atan(x).
*
* @see Math#atan(double)
*/
public static double atan(double x) {
return ATAN.applyAsDouble(x);
@ -491,6 +509,8 @@ public final class JdkMath {
* @param y Number.
* @param x Number.
* @return atan2(y, x).
*
* @see Math#atan2(double,double)
*/
public static double atan2(double y,
double x) {
@ -508,6 +528,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return cbrt(x).
*
* @see Math#cbrt(double)
*/
public static double cbrt(double x) {
return CBRT.applyAsDouble(x);
@ -516,6 +538,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return ceil(x).
*
* @see Math#ceil(double)
*/
public static double ceil(double x) {
return CEIL.applyAsDouble(x);
@ -525,6 +549,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return copySign(x, y).
*
* @see Math#copySign(float,float)
*/
public static float copySign(float x,
float y) {
@ -535,6 +561,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return copySign(x, y).
*
* @see Math#copySign(double,double)
*/
public static double copySign(double x,
double y) {
@ -544,6 +572,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return cos(x).
*
* @see Math#cos(double)
*/
public static double cos(double x) {
return COS.applyAsDouble(x);
@ -552,6 +582,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return cosh(x).
*
* @see Math#cosh(double)
*/
public static double cosh(double x) {
return COSH.applyAsDouble(x);
@ -560,6 +592,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return decrementExact(x).
*
* @see Math#decrementExact(int)
*/
public static int decrementExact(int x) {
return DECREMENTEXACT_INT.applyAsInt(x);
@ -568,6 +602,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return decrementExact(x).
*
* @see Math#decrementExact(long)
*/
public static long decrementExact(long x) {
return DECREMENTEXACT_LONG.applyAsLong(x);
@ -576,6 +612,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return exp(x).
*
* @see Math#exp(double)
*/
public static double exp(double x) {
return EXP.applyAsDouble(x);
@ -584,6 +622,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return expm1(x).
*
* @see Math#expm1(double)
*/
public static double expm1(double x) {
return EXPM1.applyAsDouble(x);
@ -592,6 +632,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return floor(x).
*
* @see Math#floor(double)
*/
public static double floor(double x) {
return FLOOR.applyAsDouble(x);
@ -601,6 +643,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return floorDiv(x, y).
*
* @see Math#floorDiv(int,int)
*/
public static int floorDiv(int x,
int y) {
@ -611,6 +655,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return floorDiv(x, y).
*
* @see Math#floorDiv(long,long)
*/
public static long floorDiv(long x,
long y) {
@ -621,6 +667,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return floorMod(x, y).
*
* @see Math#floorMod(int,int)
*/
public static int floorMod(int x,
int y) {
@ -631,6 +679,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return floorMod(x, y).
*
* @see Math#floorMod(long,long)
*/
public static long floorMod(long x,
long y) {
@ -640,6 +690,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return getExponent(x).
*
* @see Math#getExponent(float)
*/
public static int getExponent(float x) {
return GETEXPONENT_FLOAT.applyAsInt(x);
@ -648,6 +700,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return getExponent(x).
*
* @see Math#getExponent(double)
*/
public static int getExponent(double x) {
return GETEXPONENT_DOUBLE.applyAsInt(x);
@ -657,6 +711,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return hypot(x, y).
*
* @see Math#hypot(double,double)
*/
public static double hypot(double x,
double y) {
@ -667,6 +723,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return IEEEremainder(x, y).
*
* @see Math#IEEEremainder(double,double)
*/
public static double IEEEremainder(double x,
double y) {
@ -676,6 +734,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return incrementExact(x).
*
* @see Math#incrementExact(int)
*/
public static int incrementExact(int x) {
return INCREMENTEXACT_INT.applyAsInt(x);
@ -684,6 +744,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return incrementExact(x).
*
* @see Math#incrementExact(long)
*/
public static long incrementExact(long x) {
return INCREMENTEXACT_LONG.applyAsLong(x);
@ -692,6 +754,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return log(x).
*
* @see Math#log(double)
*/
public static double log(double x) {
return LOG.applyAsDouble(x);
@ -700,6 +764,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return log10(x).
*
* @see Math#log10(double)
*/
public static double log10(double x) {
return LOG10.applyAsDouble(x);
@ -708,6 +774,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return log1p(x).
*
* @see Math#log1p(double)
*/
public static double log1p(double x) {
return LOG1P.applyAsDouble(x);
@ -717,6 +785,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return max(x, y).
*
* @see Math#max(int,int)
*/
public static int max(int x,
int y) {
@ -727,6 +797,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return max(x, y).
*
* @see Math#max(long,long)
*/
public static long max(long x,
long y) {
@ -737,6 +809,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return max(x, y).
*
* @see Math#max(float,float)
*/
public static float max(float x,
float y) {
@ -747,6 +821,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return max(x, y).
*
* @see Math#max(double,double)
*/
public static double max(double x,
double y) {
@ -757,6 +833,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return min(x, y).
*
* @see Math#min(int,int)
*/
public static int min(int x,
int y) {
@ -767,6 +845,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return min(x, y).
*
* @see Math#min(long,long)
*/
public static long min(long x,
long y) {
@ -777,6 +857,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return min(x, y).
*
* @see Math#min(float,float)
*/
public static float min(float x,
float y) {
@ -787,6 +869,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return min(x, y).
*
* @see Math#min(double,double)
*/
public static double min(double x,
double y) {
@ -797,6 +881,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return multiplyExact(x, y).
*
* @see Math#multiplyExact(int,int)
*/
public static int multiplyExact(int x,
int y) {
@ -807,6 +893,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return multiplyExact(x, y).
*
* @see Math#multiplyExact(long,long)
*/
public static long multiplyExact(long x,
long y) {
@ -816,6 +904,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return negateExact(x).
*
* @see Math#negateExact(int)
*/
public static int negateExact(int x) {
return NEGATEEXACT_INT.applyAsInt(x);
@ -824,6 +914,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return negateExact(x).
*
* @see Math#negateExact(long)
*/
public static long negateExact(long x) {
return NEGATEEXACT_LONG.applyAsLong(x);
@ -833,6 +925,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return nextAfter(x, y).
*
* @see Math#nextAfter(double, double)
*/
public static double nextAfter(double x,
double y) {
@ -843,6 +937,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return nextAfter(x, y).
*
* @see Math#nextAfter(float,double)
*/
public static float nextAfter(float x,
double y) {
@ -852,6 +948,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return nextDown(x).
*
* @see Math#nextDown(double)
*/
public static double nextDown(double x) {
return NEXTDOWN_DOUBLE.applyAsDouble(x);
@ -860,6 +958,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return nextDown(x).
*
* @see Math#nextDown(float)
*/
public static float nextDown(float x) {
return NEXTDOWN_FLOAT.applyAsFloat(x);
@ -868,6 +968,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return nextUp(x).
*
* @see Math#nextUp(double)
*/
public static double nextUp(double x) {
return NEXTUP_DOUBLE.applyAsDouble(x);
@ -876,6 +978,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return nextUp(x).
*
* @see Math#nextUp(float)
*/
public static float nextUp(float x) {
return NEXTUP_FLOAT.applyAsFloat(x);
@ -885,6 +989,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return pow(x, y).
*
* @see Math#pow(double,double)
*/
public static double pow(double x,
double y) {
@ -893,6 +999,8 @@ public final class JdkMath {
/**
* @return a random number between 0 and 1.
*
* @see Math#random()
*/
public static double random() {
return RANDOM.getAsDouble();
@ -901,6 +1009,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return rint(x).
*
* @see Math#rint(double)
*/
public static double rint(double x) {
return RINT.applyAsDouble(x);
@ -909,6 +1019,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return round(x).
*
* @see Math#round(float)
*/
public static int round(float x) {
return ROUND_FLOAT.applyAsInt(x);
@ -917,6 +1029,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return round(x).
*
* @see Math#round(double)
*/
public static long round(double x) {
return ROUND_DOUBLE.applyAsLong(x);
@ -926,6 +1040,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return scalb(x, y).
*
* @see Math#scalb(double,int)
*/
public static double scalb(double x,
int y) {
@ -936,6 +1052,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return scalb(x, y).
*
* @see Math#scalb(float,int)
*/
public static float scalb(float x,
int y) {
@ -945,6 +1063,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return signum(x).
*
* @see Math#signum(double)
*/
public static double signum(double x) {
return SIGNUM_DOUBLE.applyAsDouble(x);
@ -953,6 +1073,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return signum(x).
*
* @see Math#signum(float)
*/
public static float signum(float x) {
return SIGNUM_FLOAT.applyAsFloat(x);
@ -961,6 +1083,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return sin(x).
*
* @see Math#sin(double)
*/
public static double sin(double x) {
return SIN.applyAsDouble(x);
@ -969,6 +1093,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return sinh(x).
*
* @see Math#sinh(double)
*/
public static double sinh(double x) {
return SINH.applyAsDouble(x);
@ -977,6 +1103,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return sqrt(x).
*
* @see Math#sqrt(double)
*/
public static double sqrt(double x) {
return SQRT.applyAsDouble(x);
@ -986,6 +1114,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return subtractExact(x, y).
*
* @see Math#subtractExact(int,int)
*/
public static int subtractExact(int x,
int y) {
@ -996,6 +1126,8 @@ public final class JdkMath {
* @param x Number.
* @param y Number.
* @return subtractExact(x, y).
*
* @see Math#subtractExact(long,long)
*/
public static long subtractExact(long x,
long y) {
@ -1005,6 +1137,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return tan(x).
*
* @see Math#tan(double)
*/
public static double tan(double x) {
return TAN.applyAsDouble(x);
@ -1013,6 +1147,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return tanh(x).
*
* @see Math#tanh(double)
*/
public static double tanh(double x) {
return TANH.applyAsDouble(x);
@ -1021,6 +1157,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return toDegrees(x).
*
* @see Math#toDegrees(double)
*/
public static double toDegrees(double x) {
return TODEGREES.applyAsDouble(x);
@ -1029,6 +1167,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return toIntExact(x).
*
* @see Math#toIntExact(long)
*/
public static int toIntExact(long x) {
return TOINTEXACT.applyAsInt(x);
@ -1037,6 +1177,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return toRadians(x).
*
* @see Math#toRadians(double)
*/
public static double toRadians(double x) {
return TORADIANS.applyAsDouble(x);
@ -1045,6 +1187,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return ulp(x).
*
* @see Math#ulp(double)
*/
public static double ulp(double x) {
return ULP_DOUBLE.applyAsDouble(x);
@ -1053,6 +1197,8 @@ public final class JdkMath {
/**
* @param x Number.
* @return ulp(x).
*
* @see Math#ulp(float)
*/
public static float ulp(float x) {
return ULP_FLOAT.applyAsFloat(x);