Function nalgebra_glm::trunc[][src]

pub fn trunc<T: RealField, const D: usize>(x: &TVec<T, D>) -> TVec<T, D>
Expand description

Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolute value of x.

Examples:

let vec = glm::vec3(-1.5, 0.5, 2.8);
assert_eq!(glm::vec3(-1.0, 0.0, 2.0), glm::trunc(&vec));

See also: