Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# random float between two numbers

//Notice that I think in order to use System.Random you need to import System (using System;)

static float NextFloat(float min, float max){
  System.Random random = new System.Random();
  double val = (random.NextDouble() * (max - min) + min);
  return (float)val;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #random #float #numbers
ADD COMMENT
Topic
Name
5+8 =