Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
random.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Roc authors
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 
9 //! @file roc_core/target_posix/roc_core/random.h
10 //! @brief Helpers to work with random numbers.
11 
12 #ifndef ROC_CORE_RANDOM_H_
13 #define ROC_CORE_RANDOM_H_
14 
15 #include "roc_core/stddefs.h"
16 
17 namespace roc {
18 namespace core {
19 
20 //! Get random integer.
21 //! @returns random value in range [0; upper).
22 unsigned random(unsigned upper);
23 
24 //! Get random integer.
25 //! @returns random value in range [from; to].
26 unsigned random(unsigned from, unsigned to);
27 
28 } // namespace core
29 } // namespace roc
30 
31 #endif // ROC_CORE_RANDOM_H_
Root namespace.
Commonly used types and functions.
unsigned random(unsigned upper)
Get random integer.