Difference between revisions of "Designer Primitive Operator Guide"
Line 12: | Line 12: | ||
;<kbd>Double random(), Double random(Number y), Double random(Number x, Number y)<kbd> | ;<kbd>Double random(), Double random(Number y), Double random(Number x, Number y)<kbd> | ||
:Returns a random Double selected respectively from [0, 1), [0, y), [x, y). | :Returns a random Double selected respectively from [0, 1), [0, ''y''), [''x, ''y''). | ||
;<kbd>Integer irandom(), Integer irandom(Number y), Integer irandom(Number x, Number y)<kbd> | ;<kbd>Integer irandom(), Integer irandom(Number y), Integer irandom(Number x, Number y)<kbd> | ||
:Returns a random Integer selected respectively from [0, 1), [0, y), [x, y). | :Returns a random Integer selected respectively from [0, 1), [0, ''y''), [x, ''y''). | ||
;<kbd>Double normal(Double mu, Double sigma)<kbd> | ;<kbd>Double normal(Double mu, Double sigma)<kbd> | ||
:Returns a Gaussian-distributed RN with mean <kbd>mu<kbd> and standard deviation <kbd>sigma</kbd> | :Returns a Gaussian-distributed RN with mean <kbd>mu<kbd> and standard deviation <kbd>sigma</kbd> |
Revision as of 19:14, 19 June 2022
Primop Index
On this page the primops are grouped either as universally applicable, or according to the Components in which they are meaningful. Primops used outside their designated purview will return empty answers (such as 0 or nil).
Each primop in these lists has a short description and a link to further information. Use this index to find the primop that you need, and follow the link to find out how it should be used.
Universal Primops
These primops will return meaningful results when used in any context.
Math Primops
Most mathematical operations use the Java java.lang.Math class. These include Math.abs, Math.sin, Math.cos, Math.pow (for powers), etc. The complete list is contained here.
Designer implements certain primops associated with random number generation (RNG) using an instance of the java.util.Random class. This RNG can be seeded from the platform so that the random sequence will be fixed. These primops are as follows:
- Double random(), Double random(Number y), Double random(Number x, Number y)
- Returns a random Double selected respectively from [0, 1), [0, y), [x, y).
- Integer irandom(), Integer irandom(Number y), Integer irandom(Number x, Number y)
- Returns a random Integer selected respectively from [0, 1), [0, y), [x, y).
- Double normal(Double mu, Double sigma)
- Returns a Gaussian-distributed RN with mean mu and standard deviation sigma