Class VmSafeMath

java.lang.Object
org.pkl.core.runtime.VmSafeMath

public final class VmSafeMath extends Object
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 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)