How prime number checker works
A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. The first primes are 2, 3, 5, 7, 11, 13. Numbers with more than two divisors are called composite.
This checker tests whether a given integer is prime by trial division. It first handles 2 (the only even prime) separately, then checks odd divisors from 3 up to the square root of the number. If any divisor is found, the number is composite and the smallest factor is returned.
Numbers less than 2 are not prime. The checker only accepts integers; decimal numbers are rejected. For very large numbers, the trial division approach is efficient up to about 16 digits.