add documentation
Este commit está contenido en:
padre
e4554314ed
commit
bacea22e1d
|
@ -16,8 +16,17 @@
|
|||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
/**
|
||||
* Flag para inicilizar srand solo una vez
|
||||
*/
|
||||
static int sort_rand_initialized = 0;
|
||||
|
||||
/**
|
||||
* Generar un númer al azar entre un mínimo y máximo
|
||||
* @param min El limite míninmo
|
||||
* @param max El limite máximo
|
||||
* @return Retorna el número generado
|
||||
*/
|
||||
int gen_rand(int min, int max) {
|
||||
if (sort_rand_initialized == 0) {
|
||||
srand((unsigned int) time(NULL));
|
||||
|
|
Cargando…
Referencia en una nueva incidencia