Documentation de la bibliothèque MLV-3.1.0

MLV_random.h
Aller à la documentation de ce fichier.
1 /*
2  * This file is part of the MLV Library.
3  *
4  * Copyright (C) 2010,2011,2012 Adrien Boussicault, Marc Zipstein
5  * Copyright (C) 2016 Adrien Boussicault
6  *
7  *
8  * This Library is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This Library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this Library. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
33 #ifndef __MLV__MLV_RANDOM_H__
34 #define __MLV__MLV_RANDOM_H__
35 
36 #include <stdint.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
57 void MLV_set_seed( int32_t seed );
58 
65 
74 int MLV_get_random_integer(int begin, int end);
75 
84 double MLV_get_random_double(double begin, double end);
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif
int MLV_get_random_integer(int begin, int end)
Renvoie un entier aléatoire choisi dans un intervalle donné en paramètre.
int MLV_get_random_boolean()
Renvoie 0 ou 1 aléatoirement.
double MLV_get_random_double(double begin, double end)
Renvoie un réel aléatoire choisi dans un intervalle donné en paramètre.
void MLV_set_seed(int32_t seed)
Initialise la graine du générateur de nombre interne.