Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
is_power_of_two.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * tlx/math/is_power_of_two.hpp
3  *
4  * Part of tlx - http://panthema.net/tlx
5  *
6  * Copyright (C) 2007-2017 Timo Bingmann <[email protected]>
7  *
8  * All rights reserved. Published under the Boost Software License, Version 1.0
9  ******************************************************************************/
10 
11 #ifndef TLX_MATH_IS_POWER_OF_TWO_HEADER
12 #define TLX_MATH_IS_POWER_OF_TWO_HEADER
13 
14 namespace tlx {
15 
16 //! \addtogroup tlx_math
17 //! \{
18 
19 /******************************************************************************/
20 // is_power_of_two()
21 
22 //! does what it says: true if i is a power of two
23 bool is_power_of_two(int i);
24 
25 //! does what it says: true if i is a power of two
26 bool is_power_of_two(unsigned int i);
27 
28 //! does what it says: true if i is a power of two
29 bool is_power_of_two(long i);
30 
31 //! does what it says: true if i is a power of two
32 bool is_power_of_two(unsigned long i);
33 
34 //! does what it says: true if i is a power of two
35 bool is_power_of_two(long long i);
36 
37 //! does what it says: true if i is a power of two
38 bool is_power_of_two(unsigned long long i);
39 
40 //! \}
41 
42 } // namespace tlx
43 
44 #endif // !TLX_MATH_IS_POWER_OF_TWO_HEADER
45 
46 /******************************************************************************/
bool is_power_of_two(int i)
does what it says: true if i is a power of two