Search code examples
randompidkdb+random-seed

Setting random number generator seed to a "random" number


Could you, please, let me know how I could set the random number generator seed in KDB to a more or less "random" number?

I am trying to do the following:

\S .z.i

But somehow it does not work. \S seems to expect an explicit integer, not a variable.

Thank you very much!


Solution

  • Just like with any \x command, when you need to pass a non-literal as an argument you should use system:

    system"S ",string .z.i / no backslash before S!