public final class ExactMath extends Object
Modifier and Type | Method and Description |
---|---|
static int |
multiplyHigh(int x,
int y) |
static long |
multiplyHigh(long x,
long y) |
static int |
multiplyHighUnsigned(int x,
int y) |
static long |
multiplyHighUnsigned(long x,
long y) |
static double |
truncate(double x)
Removes the decimal part (aka truncation or rounds towards zero) of the given double.
|
static float |
truncate(float x)
Removes the decimal part (aka truncation or rounds towards zero) of the given float.
|
public static int multiplyHigh(int x, int y)
public static int multiplyHighUnsigned(int x, int y)
public static long multiplyHigh(long x, long y)
public static long multiplyHighUnsigned(long x, long y)
public static float truncate(float x)
This corresponds to the IEEE 754 roundToIntegralTowardZero
operation (IEEE Std
754-2008, section 5.9, page 41).
public static double truncate(double x)
This corresponds to the IEEE 754 roundToIntegralTowardZero
operation (IEEE Std
754-2008, section 5.9, page 41).