Function glm::builtin::ldexp
[−]
[src]
pub fn ldexp<F: BaseFloat, G: GenFloat<F>, T: IntFloatRel<i32, F, G>>(
x: G,
exp: T
) -> G
Builds a floating-point number from x
and the corresponding integral
exponent of two in exp
, returning:
significand ⋅ 2exponent.
If this product is too large to be represented in the floating-point type, the result is undefined.
Example
use glm::{ ldexp, vec3, ivec3 }; assert_eq!(ldexp(2_f32, 2), 8.); let vf = vec3(1., 2., 3.); let vi = ivec3(-1, 1, 2); assert_eq!(ldexp(vf, vi), vec3(0.5, 4., 12.));