cast from float to int rust code example Example: how to convert int to float in rust let y = x as f32;