0.9.6
round.hpp
Go to the documentation of this file.
1 
39 #pragma once
40 
41 // Dependencies
42 #include "../detail/setup.hpp"
43 #include "../detail/precision.hpp"
44 #include "../detail/_vectorize.hpp"
45 #include "../vector_relational.hpp"
46 #include "../common.hpp"
47 #include <limits>
48 
49 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
50 # pragma message("GLM: GLM_GTC_integer extension included")
51 #endif
52 
53 namespace glm
54 {
57 
61  template <typename genIUType>
62  GLM_FUNC_DECL bool isPowerOfTwo(genIUType Value);
63 
67  template <typename T, precision P, template <typename, precision> class vecType>
68  GLM_FUNC_DECL vecType<bool, P> isPowerOfTwo(vecType<T, P> const & value);
69 
74  template <typename genIUType>
75  GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value);
76 
81  template <typename T, precision P, template <typename, precision> class vecType>
82  GLM_FUNC_DECL vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & value);
83 
88  template <typename genIUType>
89  GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value);
90 
95  template <typename T, precision P, template <typename, precision> class vecType>
96  GLM_FUNC_DECL vecType<T, P> floorPowerOfTwo(vecType<T, P> const & value);
97 
101  template <typename genIUType>
102  GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value);
103 
107  template <typename T, precision P, template <typename, precision> class vecType>
108  GLM_FUNC_DECL vecType<T, P> roundPowerOfTwo(vecType<T, P> const & value);
109 
113  template <typename genIUType>
114  GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple);
115 
119  template <typename T, precision P, template <typename, precision> class vecType>
120  GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple);
121 
125  template <typename T, precision P, template <typename, precision> class vecType>
126  GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple);
127 
135  template <typename genType>
136  GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple);
137 
145  template <typename T, precision P, template <typename, precision> class vecType>
146  GLM_FUNC_DECL vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple);
147 
155  template <typename genType>
156  GLM_FUNC_DECL genType floorMultiple(
157  genType Source,
158  genType Multiple);
159 
167  template <typename T, precision P, template <typename, precision> class vecType>
168  GLM_FUNC_DECL vecType<T, P> floorMultiple(
169  vecType<T, P> const & Source,
170  vecType<T, P> const & Multiple);
171 
179  template <typename genType>
180  GLM_FUNC_DECL genType roundMultiple(
181  genType Source,
182  genType Multiple);
183 
191  template <typename T, precision P, template <typename, precision> class vecType>
192  GLM_FUNC_DECL vecType<T, P> roundMultiple(
193  vecType<T, P> const & Source,
194  vecType<T, P> const & Multiple);
195 
197 } //namespace glm
198 
199 #include "round.inl"
GLM_FUNC_DECL vecType< T, P > roundMultiple(vecType< T, P > const &Source, vecType< T, P > const &Multiple)
Lower multiple number of Source.
GLM_FUNC_DECL vecType< T, P > floorPowerOfTwo(vecType< T, P > const &value)
Return the power of two number which value is just lower the input value, round down to a power of tw...
GLM_FUNC_DECL vecType< T, P > ceilPowerOfTwo(vecType< T, P > const &value)
Return the power of two number which value is just higher the input value, round up to a power of two...
GLM_FUNC_DECL vecType< T, P > floorMultiple(vecType< T, P > const &Source, vecType< T, P > const &Multiple)
Lower multiple number of Source.
Definition: _noise.hpp:31
GLM_FUNC_DECL vecType< bool, P > isPowerOfTwo(vecType< T, P > const &value)
Return true if the value is a power of two number.
GLM_FUNC_DECL vecType< bool, P > isMultiple(vecType< T, P > const &Value, vecType< T, P > const &Multiple)
Return true if the 'Value' is a multiple of 'Multiple'.
GLM_FUNC_DECL vecType< T, P > ceilMultiple(vecType< T, P > const &Source, vecType< T, P > const &Multiple)
Higher multiple number of Source.
GLM_FUNC_DECL vecType< T, P > roundPowerOfTwo(vecType< T, P > const &value)
Return the power of two number which value is the closet to the input value.