Skip to content

Instantly share code, notes, and snippets.

@hades2510
Created November 3, 2022 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hades2510/1f99c7736d23046705fc60001ea34bb6 to your computer and use it in GitHub Desktop.
Save hades2510/1f99c7736d23046705fc60001ea34bb6 to your computer and use it in GitHub Desktop.
type FIBONACCI<
C extends Byte,
A extends Byte = ONE_BYTE,
B extends Byte = ONE_BYTE
> = ONE_BYTE extends C
? A
: AddOne<ONE_BYTE> extends C
? A
: FIBONACCI<SubtractOne<C>, Add<A, B>, A>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment