Rust Century From Year
fn century_from_year(year: i64) -> i64 {
(year as f64 / 100.0).ceil() as i64
}
This converts a year into its century. Years 1-100 are century 1, 101-200 are century 2, and so on.
fn century_from_year(year: i64) -> i64 {
(year as f64 / 100.0).ceil() as i64
}
This converts a year into its century. Years 1-100 are century 1, 101-200 are century 2, and so on.