INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "Prime number properties"
title: "EiffelBase: library of reusable components for Eiffel. ", "Based on EiffelBase library for ISE Eiffel, ", "used with permission. "
project: "EiffelBase Library"
copyright: "(c) 1986-1997 Interactive Software Engineering Inc. ", "Modifications and extensions: ", "(c) 1997 Object Tools ", "All rights reserved. Duplication and distribution prohibited", "May be used only with Visual Eiffel under terms of user ", "license "
key: primes
cluster: eiffelbase
class PRIMES
inherit

COUNTABLE_SEQUENCE [INTEGER]
rename
has as is_prime
redefine
is_prime
end
feature -- Access

Smallest_prime: INTEGER

Smallest_odd_prime: INTEGER

higher_prime (n: INTEGER): INTEGER
-- Lowest prime greater than or equal to `n'

lower_prime (n: INTEGER): INTEGER
-- Greatest prime lower than or equal to `n'
require
argument_big_enough: n >= smallest_prime

all_lower_primes (n: INTEGER): ARRAY [BOOLEAN]
-- Array of `n' boolean values, where the
-- value at index `i' is true if and only if
-- `i' is prime.

is_prime (n: INTEGER): BOOLEAN
-- Is `n' a prime number?

i_th (i: INTEGER): INTEGER
-- The `i'-th prime number
end -- class PRIMES

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES