math.random

Unterstützt in:
math.random()

Beschreibung

Erzeugt einen Pseudozufallswert vom Typ DOUBLE im Bereich von [0, 1), einschließlich 0 und exklusiv 1.

Rückgabetyp

FLOAT

Codebeispiele

Im folgenden Beispiel wird geprüft, ob der Zufallswert im Bereich [0, 1) liegt. none if(math.random() >= 0 and math.random() < 1) = true