Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for fibonacci (3.04 sec)

  1. src/math/big/example_test.go

    	limit.Exp(big.NewInt(10), big.NewInt(99), nil)
    
    	// Loop while a is smaller than 1e100.
    	for a.Cmp(&limit) < 0 {
    		// Compute the next Fibonacci number, storing it in a.
    		a.Add(a, b)
    		// Swap a and b so that b is the next number in the sequence.
    		a, b = b, a
    	}
    	fmt.Println(a) // 100-digit Fibonacci number
    
    	// Test a for primality.
    	// (ProbablyPrimes' argument sets the number of Miller-Rabin
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 26 16:15:32 UTC 2020
    - 4K bytes
    - Viewed (0)
  2. misc/cgo/gmp/fib.go

    // Copyright 2009 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    //go:build ignore
    
    // Compute Fibonacci numbers with two goroutines
    // that pass integers back and forth.  No actual
    // concurrency, just threads and synchronization
    // and foreign code on multiple pthreads.
    
    package main
    
    import (
    	big "."
    	"runtime"
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 10 22:32:35 UTC 2023
    - 919 bytes
    - Viewed (0)
  3. test/fibo.go

    // Usage:
    // fibo <n>     compute fibonacci(n), n must be >= 0
    // fibo -bench  benchmark fibonacci computation (takes about 1 min)
    //
    // Additional flags:
    // -half        add values using two half-digit additions
    // -opt         optimize memory allocation through reuse
    // -short       only print the first 10 digits of very large fibonacci numbers
    
    // Command fibo is a stand-alone test and benchmark to
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 08 22:22:58 UTC 2014
    - 6.3K bytes
    - Viewed (0)
  4. src/cmd/cgo/internal/teststdio/testdata/fib.go

    // Copyright 2009 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    //go:build test_run
    
    // Compute Fibonacci numbers with two goroutines
    // that pass integers back and forth.  No actual
    // concurrency, just threads and synchronization
    // and foreign code on multiple pthreads.
    
    package main
    
    import (
    	"runtime"
    	"strconv"
    
    	"cgostdio/stdio"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 965 bytes
    - Viewed (0)
  5. src/text/tabwriter/tabwriter_test.go

    	title = testname + " (written byte-by-byte)"
    	b.clear()
    	for i := 0; i < len(src); i++ {
    		write(t, title, &w, src[i:i+1])
    	}
    	verify(t, title, &w, &b, src, expected)
    
    	// write using Fibonacci slice sizes
    	title = testname + " (written in fibonacci slices)"
    	b.clear()
    	for i, d := 0, 0; i < len(src); {
    		write(t, title, &w, src[i:i+d])
    		i, d = i+d, d+1
    		if i+d > len(src) {
    			d = len(src) - i
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 16:46:34 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  6. doc/go_spec.html

    for u = range 256 {
    }
    
    // invalid: 1e3 is a floating-point constant
    for range 1e3 {
    }
    
    // fibo generates the Fibonacci sequence
    fibo := func(yield func(x int) bool) {
    	f0, f1 := 0, 1
    	for yield(f0) {
    		f0, f1 = f1, f0+f1
    	}
    }
    
    // print the Fibonacci numbers below 1000:
    for x := range fibo {
    	if x >= 1000 {
    		break
    	}
    	fmt.Printf("%d ", x)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 21:07:21 UTC 2024
    - 281.5K bytes
    - Viewed (1)
Back to top