For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/sdk/sapi/runtime/functions/getRandomInteger.md.
  • 简体中文
  • Function: getRandomInteger()

    function getRandomInteger(min?: number, max?: number): number;

    Defined in: sapi/runtime/tools.ts:47

    生成闭区间 [min, max] 内的随机整数。

    Parameters

    ParameterTypeDefault valueDescription
    minnumber0区间下界(默认为 0)。
    maxnumber1区间上界(默认为 1)。

    Returns

    number

    区间内的随机整数。