@jossmac/lil-libs
    Preparing search index...

    Function randomBiased

    • Generates a random number within a range, following a normal (Gaussian) curve.

      • min: number

        Lower bound (inclusive).

      • max: number

        Upper bound (inclusive).

      • options: RandomBiasedOptions = {}

        Options for the distribution.

      A random float in [min, max] biased toward the peak.

      // Default: Bell curve centered at 50.
      // ~68% of results fall between 30 and 70 (50 ± 20).
      randomBiased(0, 100);

      // Shifted: Bell curve centered at 80.
      randomBiased(0, 100, { peak: 0.8 });

      // Tight spread: Bell curve sharply clustered around 50.
      // ~68% of results fall between 45 and 55 (50 ± 5).
      randomBiased(0, 100, { spread: 0.05 });