global functions

# glm::bitCount(...)

## vecType glm::bitCount(const vecType &v=P)

*Documentation from code comments*

*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*

*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 glm::bitfieldExtract(const vecType &Value=P, int Offset, int Bits)

*Documentation from code comments*

*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 glm::bitfieldInsert(const vecType &Base=P, const vecType &Insert=P, int Offset, int Bits)

*Documentation from code comments*

*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 glm::bitfieldReverse(const vecType &v=P)

*Documentation from code comments*

*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 glm::findLSB(const vecType &v=P)

*Documentation from code comments*

*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*

*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 glm::findMSB(const vecType &v=P)

*Documentation from code comments*

*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*

*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 &x=P, const vecType &y=P, vecType &msb=P, vecType &lsb=P)

*Documentation from code comments*

*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::uaddCarry(const vecType &x=P, const vecType &y=P, vecType &carry=P)

*Documentation from code comments*

*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 &x=P, const vecType &y=P, vecType &msb=P, vecType &lsb=P)

*Documentation from code comments*

*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::usubBorrow(const vecType &x=P, const vecType &y=P, vecType &borrow=P)

*Documentation from code comments*

*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 Friday, 04 January 2019 11:07:28 UTC - 02e4bdeee9fc29f88539b4e860c215150e7255a2

Hosting for openFrameworks is generously provided by Rackspace

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