Skip to content

Commit

Permalink
use Number instead of double for functions (will break things ;-) )
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Sep 10, 2024
1 parent f796742 commit 71bdd57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static Number call(PageContext pc, Number number1, Number number2, String
max = tmp;
}
int diff = max - min;
return (Caster.toIntValue(Rand.call(pc, algo)) * (diff + 1)) + min;
return Caster.toIntValue((Rand.getRandom(algo, Double.NaN).nextDouble() * (diff + 1)) + min);
}

public static int invoke(int min, int max) throws ExpressionException {
Expand Down
2 changes: 1 addition & 1 deletion test/functions/Cos.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase"{
function run( testResults , testBox ) {
describe( title="Test suite for Cos()", body=function() {
it(title="checking Cos() function", body = function( currentSpec ) {
assertEquals("-0.9899924966004455","#tostring(cos(3))#");
assertEquals("-0.989992496600","#left(tostring(cos(3)),15)#");
});
});
}
Expand Down

0 comments on commit 71bdd57

Please sign in to comment.