Alok, Your import path "github.com/alok87/goutils/random" is not valid for "go get". The source is at "github.com/alok87/goutils/pkg/random".
You write "for { rand.Seed(); rand.Intn(); }". Therefore, the range of values is not random. You write "arr[r] = rand.Intn(max) + min" which is incorrect. And so on. Peter On Sunday, July 9, 2017 at 3:02:43 PM UTC-4, alok....@practo.com wrote: > > A python like range utility which can be used for this > https://github.com/alok87/goutils/blob/master/pkg/random/random.go > ```random.RangeInt(2, 100, 3)``` > > On Wednesday, March 28, 2012 at 5:43:55 AM UTC+5:30, Guillermo Estrada > wrote: >> >> Hi, I've been reading some posts but I still have the same question. >> >> I need to generate a random number between a min and a max value of >> floats (Float64) for example: >> >> random(-0.001, 0.001) >> >> Is there any way pkg "math/rand" could do this using the Normal >> Distribution or such? Most Random generation on the pkg works in [0.0,1.0) >> The closest I found is: >> >> func (*Rand) NormFloat64 >> <http://weekly.golang.org/src/pkg/math/rand/normal.go?s=804:840#L28> >> But I need a way to clamp that range into my own, any ideas? Thnx in >> advance! >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.