Generate every prime in a range
A prime is a whole number greater than 1 with exactly two positive divisors. Both bounds are included. Between 10 and 20, the primes are 11, 13, 17 and 19. A range containing only 0 and 1 has no primes.
Why a sieve works
The segmented sieve marks multiples of each prime up to the square root of the upper bound. Every remaining number of at least 2 is prime. These results are exact within the supported range.
Range limits
The upper bound is 1 billion and the span is at most 1 million. This keeps the calculation small enough for a browser. Use the prime number checker for an individual larger integer, its factorization or a probable-prime test.