math docs
    Preparing search index...

    Function sign

    • Returns a random sign, either 1 or -1.

      Parameters

      • random: RandomGenerator

        the random generator to use

      • plusChance: number = 0.5

        the probability of returning 1, in the range [0, 1]. Defaults to 0.5.

      Returns number