use super::*;
pub fn tpx(config: &MortTableConfig, x: u32, t: u32, entry_age: Option<u32>) -> PolarsResult<f64> {
let new_config = get_new_config_with_selected_table(config, entry_age)?;
let mut result = 1.0;
for age in x..(x + t) {
let qx = get_value(&new_config, age, "qx")?;
let px = 1.0 - qx;
result *= px;
}
Ok(result)
}
pub fn tqx(config: &MortTableConfig, x: u32, t: u32, entry_age: Option<u32>) -> PolarsResult<f64> {
let result = 1.0 - tpx(config, x, t, entry_age)?;
Ok(result)
}
#[cfg(test)]
mod tests {
}