Skip to content

Commit

Permalink
fix: update function logic
Browse files Browse the repository at this point in the history
  • Loading branch information
emptyOVO committed Sep 9, 2024
1 parent ecff9a7 commit df1688d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* RandIntegerFunction
* description: RAND_INTEGER(INT1)--Returns a pseudorandom integer value in the range [0, INT)
* RAND_INTEGER(INT1, INT2)--Returns a pseudorandom integer value in the range [0, INT2) with an initial seed INT1.
* RAND_INTEGER(INT1, INT2)--Returns a pseudorandom integer value in the range [0, INT1) with an initial seed INT2.
* Two RAND_INTEGER functions will return idential sequences of numbers if they have the same initial seed and bound.
*/
@TransformFunction(names = {"rand_integer"})
Expand Down Expand Up @@ -69,7 +69,7 @@ private int randInteger(int range) {
return random.nextInt(range);
}

private int randInteger(int seed, int range) {
private int randInteger(int range, int seed) {
random.setSeed(seed);
return random.nextInt(range);
}
Expand Down

0 comments on commit df1688d

Please sign in to comment.