Created
September 15, 2020 16:07
-
-
Save fmoor/538ee60a3ff787d267ba9b75c883247a to your computer and use it in GitHub Desktop.
A cli tool to generate Fibonacci numbers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A cli tool to generate Fibonacci numbers. | |
package main | |
import "fmt" | |
func main() { | |
var a, b uint64 = 0, 1 | |
for a <= b { | |
fmt.Println(a) | |
a, b = b, a+b | |
} | |
// don't miss the last number in the sequence before overflowing uint64 | |
fmt.Println(a) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment