Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Integer.each_prime

each_prime(ubound) { |prime| ... }

Iterates the given block over all prime numbers.

See Primeeach for more details.