- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for Fastrandn (0.2 sec)
-
src/runtime/rand_test.go
// but check that all three don't return the same number (1 in 2^64 chance) { x, y, z := fastrand(), fastrand(), fastrand() if x == y && y == z { t.Fatalf("fastrand three times = %#x, %#x, %#x, want different numbers", x, y, z) } } { x, y, z := fastrandn(1e9), fastrandn(1e9), fastrandn(1e9) if x == y && y == z { t.Fatalf("fastrandn three times = %#x, %#x, %#x, want different numbers", x, y, z) } } {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Dec 07 23:44:31 UTC 2023 - 2K bytes - Viewed (0) -
src/runtime/rand.go
// Too much legacy code has go:linkname references // to runtime.fastrand and friends, so keep these around for now. // Code should migrate to math/rand/v2.Uint64, // which is just as fast, but that's only available in Go 1.22+. // It would be reasonable to remove these in Go 1.24. // Do not call these from package runtime. //go:linkname legacy_fastrand runtime.fastrand func legacy_fastrand() uint32 { return uint32(rand()) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 31 14:32:47 UTC 2024 - 8K bytes - Viewed (0) -
src/cmd/link/testdata/linkname/fastrand.go
// license that can be found in the LICENSE file. // Linkname fastrand is allowed _for now_, as it has a // linknamed definition, for legacy reason. // NOTE: this may not be allowed in the future. Don't do this! package main import _ "unsafe" //go:linkname fastrand runtime.fastrand func fastrand() uint32 func main() { println(fastrand())
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 19:57:43 UTC 2024 - 457 bytes - Viewed (0)