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

    Function randomFloat

    • Generates random floating-point numbers in a half-open range.

      Reversed bounds are automatically normalised.

      • min: number = 0

        Lower bound (inclusive). Defaults to 0; swapped with max when out of order.

      • max: number = 1

        Upper bound (exclusive). Defaults to 1; swapped with min when out of order.

      A uniformly random float in [min, max).

      randomFloat(10, 20); // 10 <= n < 20
      randomFloat(20, 10); // same as randomFloat(10, 20)
      randomFloat(); // 0 <= n < 1 (default range)