W3cubDocs

/Pony

Fibonacci[optional A: (Integer[A] val & (U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val))]

[Source]

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.

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

Constructors

create

[Source]

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

Returns

Public Functions

apply

[Source]

fun box apply(
  n: U8 val)
: A

Parameters

  • n: U8 val

Returns

  • A

has_next

[Source]

fun box has_next()
: Bool val

Returns

next

[Source]

fun ref next()
: A

Returns

  • A

© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/math-Fibonacci