global functions
glm::bitCount(...)
vecType< int, P > glm::bitCount(const vecType< T, P > &v=P)
Documentation from code comments
Returns the number of bits set to 1 in the binary representation of value.
Type parameters:
T Signed or unsigned integer scalar or vector types.
See also: GLSL bitCount man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::bitCount(...)
int glm::bitCount(genType v)
Documentation from code comments
Returns the number of bits set to 1 in the binary representation of value.
Type parameters:
T Signed or unsigned integer scalar or vector types.
See also: GLSL bitCount man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::bitfieldExtract(...)
vecType< T, P > glm::bitfieldExtract(const vecType< T, P > &Value=P, int Offset, int Bits)
Documentation from code comments
Extracts bits [offset, offset + bits - 1] from value, returning them in the least significant bits of the result. For unsigned data types, the most significant bits of the result will be set to zero. For signed data types, the most significant bits will be set to the value of bit offset + base - 1.
If bits is zero, the result will be zero. The result will be undefined if offset or bits is negative, or if the sum of offset and bits is greater than the number of bits used to store the operand.
Type parameters:
T Signed or unsigned integer scalar or vector types.
See also: GLSL bitfieldExtract man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::bitfieldInsert(...)
vecType< T, P > glm::bitfieldInsert(const vecType< T, P > &Base=P, const vecType< T, P > &Insert=P, int Offset, int Bits)
Documentation from code comments
Returns the insertion the bits least-significant bits of insert into base.
The result will have bits [offset, offset + bits - 1] taken from bits [0, bits - 1] of insert, and all other bits taken directly from the corresponding bits of base. If bits is zero, the result will simply be base. The result will be undefined if offset or bits is negative, or if the sum of offset and bits is greater than the number of bits used to store the operand.
Type parameters:
T Signed or unsigned integer scalar or vector types.
See also: GLSL bitfieldInsert man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::bitfieldReverse(...)
vecType< T, P > glm::bitfieldReverse(const vecType< T, P > &v=P)
Documentation from code comments
Returns the reversal of the bits of value. The bit numbered n of the result will be taken from bit (bits - 1) - n of value, where bits is the total number of bits used to represent value.
Type parameters:
T Signed or unsigned integer scalar or vector types.
See also: GLSL bitfieldReverse man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::findLSB(...)
vecType< int, P > glm::findLSB(const vecType< T, P > &v=P)
Documentation from code comments
Returns the bit number of the least significant bit set to 1 in the binary representation of value. If value is zero, -1 will be returned.
Type parameters:
T Signed or unsigned integer scalar types.
See also: GLSL findLSB man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::findLSB(...)
int glm::findLSB(genIUType x)
Documentation from code comments
Returns the bit number of the least significant bit set to 1 in the binary representation of value. If value is zero, -1 will be returned.
Type parameters:
T Signed or unsigned integer scalar types.
See also: GLSL findLSB man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::findMSB(...)
vecType< int, P > glm::findMSB(const vecType< T, P > &v=P)
Documentation from code comments
Returns the bit number of the most significant bit in the binary representation of value. For positive integers, the result will be the bit number of the most significant bit set to 1. For negative integers, the result will be the bit number of the most significant bit set to 0. For a value of zero or negative one, -1 will be returned.
Type parameters:
T Signed or unsigned integer scalar types.
See also: GLSL findMSB man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::findMSB(...)
int glm::findMSB(genIUType x)
Documentation from code comments
Returns the bit number of the most significant bit in the binary representation of value. For positive integers, the result will be the bit number of the most significant bit set to 1. For negative integers, the result will be the bit number of the most significant bit set to 0. For a value of zero or negative one, -1 will be returned.
Type parameters:
T Signed or unsigned integer scalar types.
See also: GLSL findMSB man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::imulExtended(...)
void glm::imulExtended(const vecType< int, P > &x=P, const vecType< int, P > &y=P, vecType< int, P > &msb=P, vecType< int, P > &lsb=P)
Documentation from code comments
Multiplies 32-bit integers x and y, producing a 64-bit result. The 32 least-significant bits are returned in lsb. The 32 most-significant bits are returned in msb.
Type parameters:
genIType Signed integer scalar or vector types.
See also: GLSL imulExtended man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::uaddCarry(...)
vecType< glm::uint, P > glm::uaddCarry(const vecType< glm::uint, P > &x=P, const vecType< glm::uint, P > &y=P, vecType< glm::uint, P > &carry=P)
Documentation from code comments
Adds 32-bit unsigned integer x and y, returning the sum modulo pow(2, 32). The value carry is set to 0 if the sum was less than pow(2, 32), or to 1 otherwise.
Type parameters:
genUType Unsigned integer scalar or vector types.
See also: GLSL uaddCarry man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::umulExtended(...)
void glm::umulExtended(const vecType< glm::uint, P > &x=P, const vecType< glm::uint, P > &y=P, vecType< glm::uint, P > &msb=P, vecType< glm::uint, P > &lsb=P)
Documentation from code comments
Multiplies 32-bit integers x and y, producing a 64-bit result. The 32 least-significant bits are returned in lsb. The 32 most-significant bits are returned in msb.
Type parameters:
genUType Unsigned integer scalar or vector types.
See also: GLSL umulExtended man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
glm::usubBorrow(...)
vecType< glm::uint, P > glm::usubBorrow(const vecType< glm::uint, P > &x=P, const vecType< glm::uint, P > &y=P, vecType< glm::uint, P > &borrow=P)
Documentation from code comments
Subtracts the 32-bit unsigned integer y from x, returning the difference if non-negative, or pow(2, 32) plus the difference otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise.
Type parameters:
genUType Unsigned integer scalar or vector types.
See also: GLSL usubBorrow man page
See also: GLSL 4.20.8 specification, section 8.8 Integer Functions
Last updated 火曜日, 19 11月 2024 17:26:10 UTC - 2537ee49f6d46d5fe98e408849448314fd1f180e
If you have any doubt about the usage of this module you can ask in the forum.
If you want to contribute better documentation or start documenting this section you can do so here
If you find anything wrong with this docs you can report any error by opening an issue