0.9.9 API documentation
Loading...
Searching...
No Matches
scalar_integer.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
13// Dependencies
14#include "../detail/setup.hpp"
15#include "../detail/qualifier.hpp"
16#include "../detail/_vectorize.hpp"
17#include "../detail/type_float.hpp"
19#include "../common.hpp"
20#include <limits>
21
22#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
23# pragma message("GLM: GLM_EXT_scalar_integer extension included")
24#endif
25
26namespace glm
27{
30
34 template<typename genIUType>
35 GLM_FUNC_DECL bool isPowerOfTwo(genIUType v);
36
41 template<typename genIUType>
42 GLM_FUNC_DECL genIUType nextPowerOfTwo(genIUType v);
43
48 template<typename genIUType>
49 GLM_FUNC_DECL genIUType prevPowerOfTwo(genIUType v);
50
54 template<typename genIUType>
55 GLM_FUNC_DECL bool isMultiple(genIUType v, genIUType Multiple);
56
65 template<typename genIUType>
66 GLM_FUNC_DECL genIUType nextMultiple(genIUType v, genIUType Multiple);
67
76 template<typename genIUType>
77 GLM_FUNC_DECL genIUType prevMultiple(genIUType v, genIUType Multiple);
78
86 template<typename genIUType>
87 GLM_FUNC_DECL int findNSB(genIUType x, int significantBitCount);
88
90} //namespace glm
91
92#include "scalar_integer.inl"
Core features
GLM_FUNC_DECL bool isMultiple(genIUType v, genIUType Multiple)
Return true if the 'Value' is a multiple of 'Multiple'.
GLM_FUNC_DECL genIUType nextMultiple(genIUType v, genIUType Multiple)
Higher multiple number of Source.
GLM_FUNC_DECL bool isPowerOfTwo(genIUType v)
Return true if the value is a power of two number.
GLM_FUNC_DECL genIUType prevPowerOfTwo(genIUType v)
Return the power of two number which value is just lower the input value, round down to a power of tw...
GLM_FUNC_DECL int findNSB(genIUType x, int significantBitCount)
Returns the bit number of the Nth significant bit set to 1 in the binary representation of value.
GLM_FUNC_DECL genIUType nextPowerOfTwo(genIUType v)
Return the power of two number which value is just higher the input value, round up to a power of two...
GLM_FUNC_DECL genIUType prevMultiple(genIUType v, genIUType Multiple)
Lower multiple number of Source.