waytale - v0.3.0
    Preparing search index...

    Function distributeIndex

    • Map non-negative integer into the range (inclusive) 0.0 to (exclusive) 1.0 with equal distribution, while respecting mappings of lower numbers. Visually speaking, this creates a distribution like the following, where each new line introduces a new number in addition to the previous lines.

      #
      #               #
      #       #       #
      #       #       #       #
      #   #   #       #       #
      #   #   #   #   #       #
      #   #   #   #   #   #   #
      #   #   #   #   #   #   #   #
      

      Parameters

      • index: number

        number to map

      Returns number

      • a number between 0 and 1