random.cpp
Go to the documentation of this file.
1 
23 #include "micros_swarm/random.h"
24 
25 namespace micros_swarm{
26 
27  int random_int(int min, int max)
28  {
29  return (rand() % (max - min + 1)) + min;
30  }
31 
32  float random_float(float min, float max)
33  {
34  float tmp_rand = rand() / float(RAND_MAX);
35  return min + max * tmp_rand;
36  }
37 
38  /*int test(void)
39  {
40  for (int i = 0; i < 15; i++) {
41  std::cout<<random_int(0, 15, time(NULL)) << " ";
42  }
43  std::cout<<std::endl;
44  return 0;
45  }*/
46 };
int random_int(int min, int max)
Definition: random.cpp:27
float random_float(float min, float max)
Definition: random.cpp:32


micros_swarm
Author(s):
autogenerated on Mon Jun 10 2019 14:02:06