figure out return values & global var
This commit is contained in:
parent
5a36bec0ba
commit
934c84e195
|
@ -1,2 +1,2 @@
|
||||||
run:
|
run:
|
||||||
go run hello.go
|
go run squiggle.go
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
- [ ] Hello world program
|
- [x] Hello world program
|
||||||
- [ ] Look into randomness sources in go
|
- [x] Look into randomness sources in go
|
||||||
|
- rand/v2 api: <https://pkg.go.dev/math/rand/v2>
|
||||||
- [ ]
|
- [ ]
|
||||||
|
|
|
@ -3,8 +3,14 @@ package main
|
||||||
import "fmt"
|
import "fmt"
|
||||||
import rand "math/rand/v2"
|
import rand "math/rand/v2"
|
||||||
|
|
||||||
|
var r = rand.New(rand.NewPCG(1, 2))
|
||||||
|
|
||||||
|
func sample_unit_normal() float64 {
|
||||||
|
return 1.0
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
r := rand.New(rand.NewPCG(1, 2))
|
|
||||||
fmt.Println("Hello world!")
|
fmt.Println("Hello world!")
|
||||||
fmt.Printf("%v\n", r.Float64())
|
fmt.Printf("%v\n", r.Float64())
|
||||||
|
fmt.Printf("%v\n", r.NormFloat64())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user