INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "The Fibonacci number sequence"
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: fibonacci
cluster: eiffelbase
class FIBONACCI
inherit

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

First: INTEGER

Second: INTEGER

higher_fibonacci (n: INTEGER): INTEGER
-- Lowest Fibonacci number greater than or equal to `n'

lower_fibonacci (n: INTEGER): INTEGER
-- Greatest Fibonacci number lower than or equal to `n'
require
argument_big_enough: n >= second

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

is_fibonacci (n: INTEGER): BOOLEAN
-- Is `n' a Fibonacci number?

i_th (i: INTEGER): INTEGER
-- The `i'-th Fibonacci number
end -- class FIBONACCI

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES