GLM  0.9.5
gtx/integer.hpp
Go to the documentation of this file.
1 
38 #ifndef GLM_GTX_integer
39 #define GLM_GTX_integer
40 
41 // Dependency:
42 #include "../glm.hpp"
43 
44 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
45 # pragma message("GLM: GLM_GTX_integer extension included")
46 #endif
47 
48 namespace glm
49 {
52 
55  int pow(int x, int y);
56 
59  int sqrt(int x);
60 
63  template <typename genIUType>
64  genIUType log2(genIUType const & x);
65 
68  unsigned int floor_log2(unsigned int x);
69 
72  int mod(int x, int y);
73 
76  template <typename genType>
77  genType factorial(genType const & x);
78 
81  typedef signed int sint;
82 
85  uint pow(uint x, uint y);
86 
89  uint sqrt(uint x);
90 
93  uint mod(uint x, uint y);
94 
97  uint nlz(uint x);
98 
100 }//namespace glm
101 
102 #include "integer.inl"
103 
104 #endif//GLM_GTX_integer
GLM_FUNC_DECL genType sqrt(genType const &x)
Returns the positive square root of x.
unsigned int floor_log2(unsigned int x)
Returns the floor log2 of x.
unsigned int uint
Unsigned integer type.
Definition: type_int.hpp:171
signed int sint
32bit signed integer.
Definition: gtx/integer.hpp:81
GLM_FUNC_DECL genType mod(genType const &x, genType const &y)
Modulus.
GLM_FUNC_DECL genType log2(genType const &x)
Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y...
genType factorial(genType const &x)
Return the factorial value of a number (!12 max, integer only) From GLM_GTX_integer extension...
GLM_FUNC_DECL genType pow(genType const &base, genType const &exponent)
Returns &#39;base&#39; raised to the power &#39;exponent&#39;.
uint nlz(uint x)
Returns the number of leading zeros.