Trait glm::SignedNum [] [src]

pub trait SignedNum: Sized + Neg<Output = Self> + Sub<Self, Output = Self> {
    fn abs(&self) -> Self;
    fn sign(&self) -> Self;
}

Trait for numerical types that have negative values.

Required Methods

Returns the absolute value of the receiver.

Returns the sign number of the receiver.

Example

use glm::{ SignedNum, dvec3 };
assert_eq!(dvec3(2.718, 0., -0.).sign(), dvec3(1., 0., 0.));

Implementors