Created
          December 7, 2018 14:25 
        
      - 
      
 - 
        
Save zwfang/ceb2d002b3a9662c8ef20735ec5a7d37 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
zwfang created this gist
Dec 7, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ package main import "fmt" func fib() func() int64 { var i int64 var j int64 = 1 return func() int64 { i, j = j, i+j return i } } func main() { a := fib() pre := (float64)(a()) for k := 1; k < 50; k++ { cur := (float64)(a()) fmt.Println(pre / cur) pre = cur } }