Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE][expressions] allow to seed random functions
useful to get deterministic random values
- Loading branch information
1 parent
af1c087
commit 65fed42
Showing
4 changed files
with
116 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"name": "rand", | ||
"type": "function", | ||
"description": "Returns a random integer within the range specified by the minimum and maximum argument (inclusive).", | ||
"description": "Returns a random integer within the range specified by the minimum and maximum argument (inclusive). If a seed is provided, the returned will always be the same, depending on the seed.", | ||
"arguments": [ {"arg":"min","description":"an integer representing the smallest possible random number desired"}, | ||
{"arg":"max","description":"an integer representing the largest possible random number desired"}], | ||
{"arg":"max","description":"an integer representing the largest possible random number desired"}, | ||
{"arg":"seed","optional":true,"default":"null","description":"any value to use as seed"}], | ||
"examples": [ { "expression":"rand(1, 10)", "returns":"8"}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"name": "randf", | ||
"type": "function", | ||
"description": "Returns a random float within the range specified by the minimum and maximum argument (inclusive).", | ||
"description": "Returns a random float within the range specified by the minimum and maximum argument (inclusive). If a seed is provided, the returned will always be the same, depending on the seed.", | ||
"arguments": [ {"arg":"min","optional":true,"default":"0.0","description":"an float representing the smallest possible random number desired"}, | ||
{"arg":"max","optional":true,"default":"1.0","description":"an float representing the largest possible random number desired"}], | ||
"examples": [ { "expression":"randf(1, 10)", "returns":"4.59258286403147"}] | ||
{"arg":"max","optional":true,"default":"1.0","description":"an float representing the largest possible random number desired"}, | ||
{"arg":"seed","optional":true,"default":"null","description":"any value to use as seed"}], | ||
"examples": [ { "expression":"randf(1, 10)", "returns":"4.59258286403147"} ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters