Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSequence ¶
func GetSequence(params sequence.GetSequenceParams, c cache.Cache) middleware.Responder
GetSequence retreives a Fibonacci sequence for a value n.
Types ¶
type FastDoublingMethod ¶
type FastDoublingMethod struct{}
FastDoublingMethod implements the Algorithm interface. It uses the fast doubling method algorithm:
F(2n) = F(n)[2*F(n+1) – F(n)] F(2n + 1) = F(n)2 + F(n+1)2
where, F(0) = 0, F(1) = 1
type NegativeNumberError ¶
type NegativeNumberError struct{}
NegativeNumberError is a custom error.
func (NegativeNumberError) Error ¶
func (e NegativeNumberError) Error() string
Error implements the Error interface.
Click to show internal directories.
Click to hide internal directories.