@stdlib/math
Version:
Standard math.
49 lines (34 loc) • 1.08 kB
Plain Text
{{alias}}( [options] )
Returns an iterator which generates a Tribonacci sequence.
The returned iterator can only generate the first 64 Tribonacci numbers, as
larger Tribonacci numbers cannot be safely represented in double-precision
floating-point format.
If an environment supports Symbol.iterator, the returned iterator is
iterable.
Parameters
----------
options: Object (optional)
Function options.
options.iter: integer (optional)
Number of iterations. Default: 64.
Returns
-------
iterator: Object
Iterator.
iterator.next(): Function
Returns an iterator protocol-compliant
object has the next
iterated value (if one exists) and a
boolean flag indicating whether the
iterator is finished.
iterator.return( [value] ): Function
Finishes an iterator and returns a provided value.
Examples
--------
> var it = {{alias}}();
> var v = it.next().value
0
> v = it.next().value
0
See Also
--------