ReactOS  0.4.15-dev-5122-g72bdbdd
random_number.cpp File Reference
#include "random_number.h"
#include "Prefix.h"
#include <functional>
#include <cstdlib>
Include dependency graph for random_number.cpp:

Go to the source code of this file.


unsigned random_number (size_t range)


unsigned random_base = 1000

Function Documentation

◆ random_number()

unsigned random_number ( size_t  range)

Definition at line 26 of file random_number.cpp.

27 {
28 #if !defined( __SGI_STL )
29  if (range == 0) return 0;
30  return (unsigned)(EH_STD::rand() + EH_STD::rand()) % range;
31 #else
32  static EH_STD::subtractive_rng rnd;
33  if (range==0) return 0;
34  return rnd(range);
35 #endif
36 }
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
GLenum GLint * range
Definition: glext.h:7539

Referenced by TestClass::get_random(), MakeRandomValue(), test_hash_resize< T >::operator()(), prepare_insert_n(), prepare_insert_range(), test_bit_vector(), test_deque(), test_hash_map(), test_hash_multimap(), test_hash_multiset(), test_hash_set(), test_list(), test_map(), test_multimap(), test_multiset(), test_rope(), test_set(), test_slist(), test_string(), and test_vector().

Variable Documentation

◆ random_base