Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnimplemented = status.Error(codes.Internal, "unimplemented") ErrNotfound = status.Error(codes.NotFound, "is not a fibonacci number") ErrTypeAssertionFailed = status.Error(codes.Internal, "type assertion failed") ErrTooBig = status.Error(codes.OutOfRange, "too big") ErrInvalidIndex = status.Error(codes.InvalidArgument, "invalid index, index must be grater than or equal to zero.") ErrInvalidNumber = status.Error(codes.InvalidArgument, "invalid number") ErrInvalidBitSize = status.Error(codes.InvalidArgument, "invalid bit size") )
Functions ¶
This section is empty.
Types ¶
type Fibonacci ¶
type Fibonacci struct {
// contains filtered or unexported fields
}
type IFibonacci ¶
type IFibonacci interface { // Next returns the next value of the fibonacci serries. F(IndexOf(n)+1) // returns error // ErrNotfound : if the n is not a valid fibonacci number // ErrTooBig : if the n bit size is bigger than configuration. Next(n *big.Int) (*big.Int, error) // F calculates the nth element of the fibonacci series. F(n int) (*big.Int, error) }
Click to show internal directories.
Click to hide internal directories.