Skip to content · ⁨Passer au contenu⁩

Factorial (mind the size) · ⁨Factorielle (attention à la taille)⁩

English

Factorial (mind the size)

n! is 1 × 2 × … × n, and 0! is 1. It grows fast — 20! is over two billion billion — so the method returns a long, not an int, or the answer would overflow. Multiply from 2 up to n.

Français

Factorielle (attention à la taille)

n! est 1 × 2 × … × n, et 0! est 1. Cela croît vite — 20! dépasse deux milliards de milliards — donc la méthode retourne un long, pas un int, sinon la réponse déborderait. Multipliez de 2 jusqu'à n.

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

IGCSE, A-Level & AP