# Fibonacci\[optional A: ([Integer](builtin-Integer)\[A\] val & ([U8](builtin-U8) val | [U16](builtin-U16) val | [U32](builtin-U32) val | [U64](builtin-U64) val | [U128](builtin-U128) val | [ULong](builtin-ULong) val | [USize](builtin-USize) val))\]
<span class="source-link">[[Source]](src/math/fibonacci.md#L15)</span>

Useful for microbenchmarks to impress your friends. Look y'all, Pony goes
fast! We suppose if you are into Agile planning poker that you could also
use this in conjunction with `Random` to assign User Story Points.


```pony
class ref Fibonacci[optional A: (Integer[A] val & (U8 val | U16 val | U32 val | 
    U64 val | U128 val | ULong val | 
    USize val))] is
  Iterator[A] ref
```

#### Implements

* [Iterator](builtin-Iterator)\[A\] ref

---

## Constructors

### create
<span class="source-link">[[Source]](src/math/fibonacci.md#L15)</span>


```pony
new iso create()
: Fibonacci[A] iso^
```

#### Returns

* [Fibonacci](math-Fibonacci)\[A\] iso^

---

## Public Functions

### apply
<span class="source-link">[[Source]](src/math/fibonacci.md#L25)</span>


```pony
fun box apply(
  n: U8 val)
: A
```
#### Parameters

*   n: [U8](builtin-U8) val

#### Returns

* A

---

### has_next
<span class="source-link">[[Source]](src/math/fibonacci.md#L43)</span>


```pony
fun box has_next()
: Bool val
```

#### Returns

* [Bool](builtin-Bool) val

---

### next
<span class="source-link">[[Source]](src/math/fibonacci.md#L45)</span>


```pony
fun ref next()
: A
```

#### Returns

* A

---

