Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fibonacci

Vašek edited this page Feb 6, 2019 · 2 revisions

fibonacci

This function returns the number from the fibonacci's sequence on the given position

Syntax:

fibonacci(n)
Argument Description
int n Position in the fibonacci's sequence

Returns: int

Description:

Fibonacci's sequence is an infinite row of numbers. Each number is the sum of the two preceding ones, starting from 0 and 1. The beginning of the sequence is thus: 0, 1, 1, 2, 3, 5, 8, 13, 21,... This function returns a number on the given position.

Example:

int value = fibonacci(6);

0, 1, 1, 2, 3, 5, 8. This function will return the number in sequnce on the 6th position (counting from 0). So this function will set value to 8.

Back to number_functions

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /