-
-
Notifications
You must be signed in to change notification settings - Fork 6
Fibonacci
Taiizor edited this page Mar 1, 2023
·
11 revisions
<title>Fibonacci Class</title>
The Fibonacci class provides methods to generate Fibonacci sequences of different numeric types.
The Fibonacci class is defined in the Skylark.Standard.Helper namespace.
The following using statement is required to access the Fibonacci class:
using SHL = Skylark.Helper.Length;
using Skylark.Standard.Helper;
The Fibonacci class is declared as follows:
public static class Fibonacci
{
// methods here
}
The Fibonacci class provides the following methods:
The Int method returns an array of Fibonacci numbers as integers.
public static int[] Int(int Count = 2);
Parameter | Description |
---|---|
Count | The number of Fibonacci numbers to generate. |
An array of Count Fibonacci numbers as integers.
The method may throw the following exceptions:
- System.ArgumentOutOfRangeException: if Count is less than 2 or greater than 47.
int[] fibonacciNumbers = Fibonacci.Int(10);
foreach (int number in fibonacciNumbers)
{
Console.Write(number + " ");
}
// Output: 0 1 1 2 3 5 8 13 21 34
The IntAsync method asynchronously returns an array of Fibonacci numbers as integers.
public static Task<int[]> IntAsync(int Count = 2);
Parameter | Description |
---|---|
Count | The number of Fibonacci numbers to generate. |
An awaitable task that returns an array of Count Fibonacci numbers as integers.
The method may throw the following exceptions:
- System.ArgumentOutOfRangeException: if Count is less than 2 or greater than 47.
int[] fibonacciNumbers = await Fibonacci.IntAsync(10);
foreach (int number in fibonacciNumbers)
{
Console.Write(number + " ");
}
// Output: 0 1 1 2 3 5 8 13 21 34
The Long method returns an array of Fibonacci
- Tax
- Url
- Web
- Ping
- Port
- Text
- Time
- Hash
- Word
- Color
- Speed
- Lottery
- Storage
- Browser
- Unicode
- Password
- JavaScript
- Cryptology
- Typography
- Temperature
- Compression
- Decompression
- Cascading Style Sheets
- JavaScript Object Notation
- Hypertext Markup Language
- Extensible Markup Language
- Extensible HyperText Markup Language