Package org.pkl.core.runtime
Class VmSafeMath
java.lang.Object
org.pkl.core.runtime.VmSafeMath
Uses methods from [java.lang.(Strict)Math] where appropriate, which may benefit from special
optimization by Graal. To control error messages in a single place (namely here),
[ArithmeticException]s thrown by [java.lang.StrictMath] are caught and rethrown.
-
Method Summary
Modifier and TypeMethodDescriptionstatic longabs(long x) static doubleadd(double x, double y) static longadd(long x, long y) static longdecrement(long x) static longincrement(long x) static doublemultiply(double x, double y) static longmultiply(long x, long y) static doublenegate(double x) static longnegate(long x) static longpow(long x, long y) static doubleremainder(double x, double y) static longremainder(long x, long y) static longtoInt(double x, com.oracle.truffle.api.nodes.Node sourceNode) static inttoInt32(long x) static doubletruncate(double x) static longtruncatingDivide(long x, long y)
-
Method Details
-
negate
public static long negate(long x) -
negate
public static double negate(double x) -
add
public static long add(long x, long y) -
add
public static double add(double x, double y) -
multiply
public static long multiply(long x, long y) -
multiply
public static double multiply(double x, double y) -
truncatingDivide
public static long truncatingDivide(long x, long y) -
remainder
public static long remainder(long x, long y) -
remainder
public static double remainder(double x, double y) -
toInt32
public static int toInt32(long x) -
truncate
public static double truncate(double x) -
toInt
public static long toInt(double x, com.oracle.truffle.api.nodes.Node sourceNode) -
increment
public static long increment(long x) -
decrement
public static long decrement(long x) -
abs
public static long abs(long x) -
pow
public static long pow(long x, long y)
-