InseeFr / Trevas-TS

JavaScript engine for the Validation and Transformation Language
MIT License
9 stars 8 forks source link

Implementing the `random` operator #128

Open romaintailhurat opened 11 months ago

romaintailhurat commented 11 months ago

If we think the VTL spec is stable we may start implementing the random operator.

The current state of the spec is:

Syntax random ( { seed (op) })
Input parameters op :: number
Examples of valid syntax random() random(seed (10)) Semantics for scalar operations The operator returns a random decimal number >= 0 and <1. By default, random() produces different results each time it is calculated. Set the seed parameter to a constant to return the same pseudo-random numbers.