Random float function
Posted: Thu Mar 03, 2011 2:21 am
Hi.
I've been looking for a good pseudo random function for floating numbers with range (min and max), and I've found this on a PHP code website...
I can't say it doesn't "work", but well...
Does anyone have a good algorythm for that?
(I've been searching in the forums and have found some functions for that but none with min and max parameters)
I've been looking for a good pseudo random function for floating numbers with range (min and max), and I've found this on a PHP code website...
Code: Select all
Procedure.f randf(min.f,max.f)
ProcedureReturn (min+ValF("0."+Str(Random(999)))*(Abs(max-min)));
EndProcedure
Does anyone have a good algorythm for that?
(I've been searching in the forums and have found some functions for that but none with min and max parameters)