I’d like to generate random numbers in a range (say between 0 and 1) – but with a certain step size (say 0.05).
There’s a python function that does exactly that:
random.randrange ( [start,] stop [,step] )
So my problem is not how to generate random numbers in a range – instead I need a way to do this with a certain step size.
How can this be done in .NET?
You could generate a random integer between 0 and 20 and divide the result by 20
This will give you a random number between 0 and 1 (inclusive) in 0.05 increments