Skip to content · ⁨Saltar al contenido⁩

Factorial (mind the size) · ⁨Factorial (cuidado con el tamaño)⁩

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.

Español

Factorial (cuidado con el tamaño)

n! es 1 × 2 × … × n, y 0! es 1. Crece rápidamente — 20! supera los dos billones de billones — por lo que el método devuelve un long, no un int, para evitar desbordamientos. Multiplica desde 2 hasta n.

Log in or create account · ⁨Iniciar sesión o crear cuenta⁩

IGCSE, A-Level & AP