Zufallszahl

Previous topic - Next topic

Worebu

Hallo Leute,
kann mir einer sagen wieso mir hier manchmal eine auch eine Null generiert wird?

k = RND(53+1)

Ich sage doch extra +1, also kann theoretisch doch keine Null auftauchen, oder?

Dank im voraus für einen Tip.
Intel I5 9600 - RTX 4070, WaKü, 32GB RAM, 1x 512gb + 1x 1Gb NVRAM,  1x4TB + 1x1TB HD

erico

#1
Keep the extra math off the brackets.
k=rnd(53)+1

The explanation is that the in brackets comes first, then it adds a 1.
In your case, (53+1) comes first, so you are actually pooling rnd(54).

Have you been skipping you math classes? :P

Worebu

Alles klar, kleiner Flüchtigkeitsfehler, solange hingeguckt und nichts gesehen. Danke. Und immer schön den Ball flach halten, Professor.
Intel I5 9600 - RTX 4070, WaKü, 32GB RAM, 1x 512gb + 1x 1Gb NVRAM,  1x4TB + 1x1TB HD