diff --git a/nalgebra-glm/src/common.rs b/nalgebra-glm/src/common.rs index 06d90813..e038046c 100644 --- a/nalgebra-glm/src/common.rs +++ b/nalgebra-glm/src/common.rs @@ -220,7 +220,7 @@ pub fn fract(x: &TVec) -> TVec /// * [`uint_bits_to_float`](fn.uint_bits_to_float.html) /// * [`uint_bits_to_float_scalar`](fn.uint_bits_to_float_scalar.html) pub fn int_bits_to_float(v: i32) -> f32 { - unsafe { mem::transmute(v) } + f32::from_bits(v as u32) } @@ -409,7 +409,7 @@ pub fn trunc(x: &TVec) -> TVec /// * [`int_bits_to_float_vec`](fn.int_bits_to_float_vec.html) /// * [`uint_bits_to_float`](fn.uint_bits_to_float.html) pub fn uint_bits_to_float_scalar(v: u32) -> f32 { - unsafe { mem::transmute(v) } + f32::from_bits(v) }