Function glm::builtin::uaddCarry [] [src]

pub fn uaddCarry<T: GenUType>(x: T, y: T) -> (T, T)

Adds 32-bit unsigned integer x and y, returning the sum modulus 232 and the carry bit.

Carry is set to 0 if the sum was less than 232, or to 1 otherwise.

Note

In GLSL, the carry bit is returned via the output parameter carry.

Example

use glm::{ uvec2, uaddCarry };

let v = uvec2(0xFFFFFFFE, 0);
assert_eq!(uaddCarry(v, uvec2(3, 3)), (uvec2(1, 3), uvec2(1, 0)))