Skip to content · ⁨Passer au contenu⁩

The Math Class · ⁨La classe Math⁩

Handout · ⁨Fiche de cours⁩ Watch lesson · ⁨Regarder la leçon⁩

Trace a random range at both ends

  • Tickets need integer labels from 4 through 9 inclusive. Use (int)(Math.random() * 6) + 4.
  • Scaling gives values from 0 up to but not including 6; truncating gives 0 through 5; shifting gives 4 through 9.
Trace a random range at both ends

Handout · ⁨Fiche de cours⁩

Log in or create account · ⁨Se connecter ou créer un compte⁩

IGCSE, A-Level & AP