Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 258 for prand (0.06 sec)

  1. src/math/rand/v2/rand.go

    }
    
    // New returns a new Rand that uses random values from src
    // to generate other random values.
    func New(src Source) *Rand {
    	return &Rand{src: src}
    }
    
    // Int64 returns a non-negative pseudo-random 63-bit integer as an int64.
    func (r *Rand) Int64() int64 { return int64(r.src.Uint64() &^ (1 << 63)) }
    
    // Uint32 returns a pseudo-random 32-bit value as a uint32.
    func (r *Rand) Uint32() uint32 { return uint32(r.src.Uint64() >> 32) }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 02:25:49 UTC 2024
    - 12.8K bytes
    - Viewed (0)
  2. src/math/rand/rand.go

    	readPos int8
    }
    
    // New returns a new [Rand] that uses random values from src
    // to generate other random values.
    func New(src Source) *Rand {
    	s64, _ := src.(Source64)
    	return &Rand{src: src, s64: s64}
    }
    
    // Seed uses the provided seed value to initialize the generator to a deterministic state.
    // Seed should not be called concurrently with any other [Rand] method.
    func (r *Rand) Seed(seed int64) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:09:08 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  3. src/sort/sort_test.go

    				data := tmp1[0:n]
    				for i := 0; i < n; i++ {
    					switch dist {
    					case _Sawtooth:
    						data[i] = i % m
    					case _Rand:
    						data[i] = rand.IntN(m)
    					case _Stagger:
    						data[i] = (i*m + i) % n
    					case _Plateau:
    						data[i] = min(i, m)
    					case _Shuffle:
    						if rand.IntN(m) != 0 {
    							j += 2
    							data[i] = j
    						} else {
    							k += 2
    							data[i] = k
    						}
    					}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:41:04 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  4. cmd/erasure-decode_test.go

    // You should have received a copy of the GNU Affero General Public License
    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package cmd
    
    import (
    	"bytes"
    	"context"
    	crand "crypto/rand"
    	"io"
    	"math/rand"
    	"testing"
    
    	"github.com/dustin/go-humanize"
    )
    
    func (a badDisk) ReadFile(ctx context.Context, volume string, path string, offset int64, buf []byte, verifier *BitrotVerifier) (n int64, err error) {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Jan 30 20:43:25 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/util/proxy/streamtranslator_test.go

    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package proxy
    
    import (
    	"bytes"
    	"context"
    	"crypto/rand"
    	"encoding/json"
    	"errors"
    	"fmt"
    	"io"
    	"math"
    	mrand "math/rand"
    	"net/http"
    	"net/http/httptest"
    	"net/url"
    	"reflect"
    	"strings"
    	"testing"
    	"time"
    
    	v1 "k8s.io/api/core/v1"
    	apierrors "k8s.io/apimachinery/pkg/api/errors"
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Feb 27 23:21:55 UTC 2024
    - 36.4K bytes
    - Viewed (0)
  6. src/crypto/tls/handshake_messages_test.go

    		panic("rand.Read failed: " + err.Error())
    	}
    	return r
    }
    
    func randomString(n int, rand *rand.Rand) string {
    	b := randomBytes(n, rand)
    	return string(b)
    }
    
    func (*clientHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
    	m := &clientHelloMsg{}
    	m.vers = uint16(rand.Intn(65536))
    	m.random = randomBytes(32, rand)
    	m.sessionId = randomBytes(rand.Intn(32), rand)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  7. src/testing/quick/quick.go

    	Values func([]reflect.Value, *rand.Rand)
    }
    
    var defaultConfig Config
    
    // getRand returns the *rand.Rand to use for a given Config.
    func (c *Config) getRand() *rand.Rand {
    	if c.Rand == nil {
    		return rand.New(rand.NewSource(time.Now().UnixNano()))
    	}
    	return c.Rand
    }
    
    // getMaxCount returns the maximum number of iterations to run for a given
    // Config.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 17:55:47 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/translate/tf_mlir_translate.cc

                rand_val = mlir::IntegerAttr::get(element_type, std::rand());
              } else if (element_type.isF16() || element_type.isF32() ||
                         element_type.isF64()) {
                rand_val = mlir::FloatAttr::get(element_type,
                                                std::rand() * 1.0 / RAND_MAX);
    
              } else {
                inst.emitWarning()
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 07 11:51:44 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  9. src/crypto/ecdsa/ecdsa_test.go

    	case elliptic.P224().Params():
    		_, _, err := randomPoint(p224(), rand)
    		return err
    	case elliptic.P256().Params():
    		_, _, err := randomPoint(p256(), rand)
    		return err
    	case elliptic.P384().Params():
    		_, _, err := randomPoint(p384(), rand)
    		return err
    	case elliptic.P521().Params():
    		_, _, err := randomPoint(p521(), rand)
    		return err
    	default:
    		panic("unknown curve")
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:58 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go

    	partLen := c.Rand.Intn(64) // len is [0, 63]
    	if !canBeEmpty {
    		partLen = c.Rand.Intn(63) + 1 // len is [1, 63]
    	}
    
    	runes := make([]rune, partLen)
    	if partLen == 0 {
    		return string(runes)
    	}
    
    	runes[0] = validStartEnd[c.Rand.Intn(len(validStartEnd))].choose(c.Rand)
    	for i := range runes[1:] {
    		runes[i+1] = validMiddle[c.Rand.Intn(len(validMiddle))].choose(c.Rand)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 03 15:12:26 UTC 2024
    - 9.9K bytes
    - Viewed (0)
Back to top