add documentation

This commit is contained in:
Chris Cromer 2018-11-11 13:27:59 -03:00
parent e4554314ed
commit bacea22e1d
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
1 changed files with 9 additions and 0 deletions

View File

@ -16,8 +16,17 @@
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
/**
* Flag para inicilizar srand solo una vez
*/
static int sort_rand_initialized = 0; 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) { int gen_rand(int min, int max) {
if (sort_rand_initialized == 0) { if (sort_rand_initialized == 0) {
srand((unsigned int) time(NULL)); srand((unsigned int) time(NULL));