Package com.oracle.truffle.api
Class ExactMath
java.lang.Object
com.oracle.truffle.api.ExactMath
This class contains methods that will be part of java.lang.Math starting with JDK 8. Until JDK 8
is release, we duplicate them here because they are generally useful for dynamic language
implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
addExact
(int x, int y) static long
addExact
(long x, long y) static int
multiplyExact
(int x, int y) static long
multiplyExact
(long x, long y) 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 int
subtractExact
(int x, int y) static long
subtractExact
(long x, long y)
-
Constructor Details
-
ExactMath
public ExactMath()
-
-
Method Details
-
addExact
public static int addExact(int x, int y) -
addExact
public static long addExact(long x, long y) -
subtractExact
public static int subtractExact(int x, int y) -
subtractExact
public static long subtractExact(long x, long y) -
multiplyExact
public static int multiplyExact(int x, int y) -
multiplyExact
public static long multiplyExact(long x, long y) -
multiplyHigh
public static int multiplyHigh(int x, int y) -
multiplyHighUnsigned
public static int multiplyHighUnsigned(int x, int y) -
multiplyHigh
public static long multiplyHigh(long x, long y) -
multiplyHighUnsigned
public static long multiplyHighUnsigned(long x, long y)
-