note description: "Prime number properties" library: "Free implementation of ELKS library" status: "See notice at end of class." legal: "See notice at end of class." names: primes date: "$Date: 2018-10-03 13:41:17 +0000 (Wed, 03 Oct 2018) $" revision: "$Revision: 102260 $" class interface PRIMES create default_create feature -- Access Smallest_prime: INTEGER_32 = 2 Smallest_odd_prime: INTEGER_32 = 3 higher_prime (n: INTEGER_32): INTEGER_32 -- Lowest prime greater than or equal to n ensure instance_free: class lower_prime (n: INTEGER_32): INTEGER_32 -- Greatest prime lower than or equal to n require argument_big_enough: n >= Smallest_prime ensure instance_free: class all_lower_primes (n: INTEGER_32): ARRAY [BOOLEAN] -- Array of n boolean values, where the -- value at index i is true if and only if -- i is prime. ensure instance_free: class is_prime (n: INTEGER_32): BOOLEAN -- Is n a prime number? ensure then instance_free: class i_th (i: INTEGER_32): INTEGER_32 -- The i-th prime number ensure then instance_free: class feature -- Iteration new_cursor: PRIMES -- Fresh cursor associated with current structure ensure then instance_free: class note copyright: "Copyright (c) 1984-2018, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class PRIMES
Generated by ISE EiffelStudio