Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 71 for rand1 (0.04 sec)

  1. src/runtime/rand.go

    	mp.chacha8.Init64(seed)
    	mp.cheaprand = rand()
    }
    
    // randn is like rand() % n but faster.
    // Do not change signature: used via linkname from other packages.
    //
    //go:nosplit
    //go:linkname randn
    func randn(n uint32) uint32 {
    	// See https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
    	return uint32((uint64(uint32(rand())) * uint64(n)) >> 32)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 14:32:47 UTC 2024
    - 8K bytes
    - Viewed (0)
  2. src/crypto/rand/rand.go

    // Copyright 2010 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.
    
    // Package rand implements a cryptographically secure
    // random number generator.
    package rand
    
    import "io"
    
    // Reader is a global, shared instance of a cryptographically
    // secure random number generator.
    //
    //   - On Linux, FreeBSD, Dragonfly, and Solaris, Reader uses getrandom(2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 19 20:02:21 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  3. api/go1.22.txt

    pkg math/rand/v2, method (*Rand) Int32() int32 #61716
    pkg math/rand/v2, method (*Rand) Int32N(int32) int32 #61716
    pkg math/rand/v2, method (*Rand) Int64() int64 #61716
    pkg math/rand/v2, method (*Rand) Int64N(int64) int64 #61716
    pkg math/rand/v2, method (*Rand) IntN(int) int #61716
    pkg math/rand/v2, method (*Rand) NormFloat64() float64 #61716
    pkg math/rand/v2, method (*Rand) Perm(int) []int #61716
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 20:54:27 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  4. pkg/apis/batch/fuzzer/fuzzer.go

    			}
    		},
    		func(j *batch.JobSpec, c fuzz.Continue) {
    			c.FuzzNoCustom(j) // fuzz self without calling this function again
    			completions := int32(c.Rand.Int31())
    			parallelism := int32(c.Rand.Int31())
    			backoffLimit := int32(c.Rand.Int31())
    			j.Completions = &completions
    			j.Parallelism = &parallelism
    			j.BackoffLimit = &backoffLimit
    			j.ManualSelector = pointer.Bool(c.RandBool())
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 05 17:25:15 UTC 2024
    - 3K bytes
    - Viewed (0)
  5. cmd/erasure-common.go

    package cmd
    
    import (
    	"context"
    	"fmt"
    	"io"
    	"math/rand"
    	"sync"
    	"time"
    
    	"github.com/minio/pkg/v3/sync/errgroup"
    )
    
    func (er erasureObjects) getOnlineDisks() (newDisks []StorageAPI) {
    	disks := er.getDisks()
    	var wg sync.WaitGroup
    	var mu sync.Mutex
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    	for _, i := range r.Perm(len(disks)) {
    		i := i
    		wg.Add(1)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  6. src/internal/trace/mud_test.go

    // license that can be found in the LICENSE file.
    
    package trace
    
    import (
    	"math"
    	"math/rand"
    	"testing"
    )
    
    func TestMUD(t *testing.T) {
    	// Insert random uniforms and check histogram mass and
    	// cumulative sum approximations.
    	rnd := rand.New(rand.NewSource(42))
    	mass := 0.0
    	var mud mud
    	for i := 0; i < 100; i++ {
    		area, l, r := rnd.Float64(), rnd.Float64(), rnd.Float64()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  7. test/stress/runstress.go

    	if *v {
    		log.Println(a...)
    	}
    }
    
    func dialStress(a net.Addr) {
    	for {
    		d := net.Dialer{Timeout: time.Duration(rand.Intn(1e9))}
    		c, err := d.Dial("tcp", a.String())
    		if err == nil {
    			Println("did dial")
    			go func() {
    				time.Sleep(time.Duration(rand.Intn(500)) * time.Millisecond)
    				c.Close()
    				Println("closed dial")
    			}()
    		}
    		// Don't run out of ephemeral ports too quickly:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:35 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  8. src/sort/sort_slices_benchmark_test.go

    package sort_test
    
    import (
    	"math/rand/v2"
    	"slices"
    	. "sort"
    	"strconv"
    	stringspkg "strings"
    	"testing"
    )
    
    // Benchmarks comparing sorting from the slices package with functions from
    // the sort package (avoiding functions that are just forwarding to the slices
    // package).
    
    func makeRandomInts(n int) []int {
    	r := rand.New(rand.NewPCG(42, 0))
    	ints := make([]int, n)
    	for i := 0; i < n; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 22:59:40 UTC 2024
    - 4K bytes
    - Viewed (0)
  9. src/sync/map_test.go

    	}
    }
    
    type mapResult struct {
    	value any
    	ok    bool
    }
    
    func randValue(r *rand.Rand) any {
    	b := make([]byte, r.Intn(4))
    	for i := range b {
    		b[i] = 'a' + byte(rand.Intn(26))
    	}
    	return string(b)
    }
    
    func (mapCall) Generate(r *rand.Rand, size int) reflect.Value {
    	c := mapCall{op: mapOps[rand.Intn(len(mapOps))], k: randValue(r)}
    	switch c.op {
    	case opStore, opLoadOrStore:
    		c.v = randValue(r)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 15:34:22 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  10. src/crypto/ecdsa/ecdsa_legacy.go

    )
    
    // This file contains a math/big implementation of ECDSA that is only used for
    // deprecated custom curves.
    
    func generateLegacy(c elliptic.Curve, rand io.Reader) (*PrivateKey, error) {
    	k, err := randFieldElement(c, rand)
    	if err != nil {
    		return nil, err
    	}
    
    	priv := new(PrivateKey)
    	priv.PublicKey.Curve = c
    	priv.D = k
    	priv.PublicKey.X, priv.PublicKey.Y = c.ScalarBaseMult(k.Bytes())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:11:18 UTC 2024
    - 4.8K bytes
    - Viewed (0)
Back to top