Skip to content

Commit

Permalink
Update math/rand
Browse files Browse the repository at this point in the history
  • Loading branch information
itsubaki committed Feb 7, 2024
1 parent a99ec3f commit 427552b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions math/rand/math.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package rand

import "math/rand/v2"

func Float64() func() float64 {
return rand.Float64
}
var Float64 = rand.Float64
2 changes: 1 addition & 1 deletion math/rand/math_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestFloat64(t *testing.T) {
r := rand.Float64()()
r := rand.Float64()
if r >= 0 && r < 1 {
return
}
Expand Down
2 changes: 1 addition & 1 deletion q.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Q struct {
func New() *Q {
return &Q{
qb: nil,
Rand: rand.Float64(),
Rand: rand.Float64,
}
}

Expand Down
2 changes: 1 addition & 1 deletion q_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ func Example_deutschJozsa() {
)

oracle := func(qsim *q.Q, q0, q1 q.Qubit) FuncType {
if rand.Float64()() > 0.5 {
if rand.Float64() > 0.5 {
return Constant
}

Expand Down

0 comments on commit 427552b

Please sign in to comment.