Clarify comments and names in inflation code (#11977)

This commit is contained in:
Ryo Onodera
2020-09-03 14:15:12 +09:00
committed by GitHub
parent 29cfbce21d
commit 89bca6110a
2 changed files with 10 additions and 7 deletions

View File

@ -55,6 +55,7 @@ impl Inflation {
}
/// inflation rate at year
pub fn total(&self, year: f64) -> f64 {
assert!(year >= 0.0);
let tapered = self.initial * ((1.0 - self.taper).powf(year));
if tapered > self.terminal {