Function glm::builtin::floatBitsToUint [] [src]

pub fn floatBitsToUint<G: GenUType, T: FloatIntRel<f32, u32, G>>(value: T) -> G

Returns a unsigned integer value representing the encoding of a floating-point value.

The floating- point value's bit-level representation is preserved.

Example

use glm::{ floatBitsToUint, vec3, uvec3 };
use num::Float;

let f = 1_f32;
let u = floatBitsToUint(f);
assert_eq!(u, 0x3F800000);
let inf: f32 = Float::infinity();
let v = vec3(0.2, 0., inf);
assert_eq!(floatBitsToUint(v), uvec3(0x3E4CCCCD, 0, 0x7f800000));