Make memory sizes parameters
This commit is contained in:
@@ -5,7 +5,7 @@ import "math/rand"
|
||||
// Generate a random uint64 with an even distribution of bits.Len64()
|
||||
func RandBiasedUint64() uint64 {
|
||||
// The shift-right by up to 64 (shifting it to 0) makes up for randomness
|
||||
// lost by setting the high bit.
|
||||
// lost by setting the high bit.
|
||||
return (rand.Uint64() | 0x8000000000000000) >> rand.Intn(65)
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ func RandBiasedInt64() uint64 {
|
||||
if shift < 64 {
|
||||
return uint64(int64((rand.Uint64() | 0x8000000000000000) >> (shift + 1)))
|
||||
} else {
|
||||
return uint64(int64((rand.Uint64() | 0x8000000000000000) >> (shift - 63)) * -1)
|
||||
return uint64(int64((rand.Uint64()|0x8000000000000000)>>(shift-63)) * -1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user