diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/Choose.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/Choose.java index 6dc04a9255387cc41f8b9a905923b71dbbbd870c..2f721295ac66a33f2d87ab2941bae1fe1aafcafb 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/Choose.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/Choose.java @@ -15,6 +15,7 @@ package com.oracle.truffle.r.runtime.nmath; import static com.oracle.truffle.r.runtime.nmath.GammaFunctions.lgammafn; import static com.oracle.truffle.r.runtime.nmath.GammaFunctions.lgammafnSign; +import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.r.runtime.RError.Message; // transcribed from nmath/choose.c @@ -26,6 +27,7 @@ public class Choose { return -Math.log(n + 1.) - LBeta.lbeta(n - k + 1., k + 1.); } + @TruffleBoundary public static double choose(double n, double ka) { double k = ka; if (Double.isNaN(n) || Double.isNaN(ka)) { @@ -76,6 +78,7 @@ public class Choose { return Math.exp(lfastchoose(n, k)); } + @TruffleBoundary public static double lchoose(double n, double kIn) { double k = RMath.forceint(kIn); /* NaNs propagated correctly */