repo.or.cz
/
C-Data-Structures.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Updated project to use eclipse build tools and make system.
[C-Data-Structures.git]
/
lib_random.c
blob
34313527e3e2bc05e4f3177f61ae5a516f4b2b4b
1
#include <assert.h>
2
#include <limits.h>
3
#include <stdlib.h>
4
#include <time.h>
5
6
#include
"lib_random.h"
7
8
int
random_int
(
int
min
,
int
max
)
9
{
10
assert
(
min
>
INT_MIN
);
11
assert
(
max
<
INT_MAX
/
2
);
12
assert
(
max
>=
min
);
13
return
rand
() %
max
+
min
;
14
}
15
16
void
random_seed
()
17
{
18
srand
(
time
(
0
));
19
}