From 2fade7f4dc56479027abf4e196a2f1e04c032eee Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 29 Oct 2017 18:34:18 +0100 Subject: [PATCH] Added calculation --- Business/Finance/FinanceFormulas.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Business/Finance/FinanceFormulas.php b/Business/Finance/FinanceFormulas.php index 4d1ffda5b..7a311317a 100644 --- a/Business/Finance/FinanceFormulas.php +++ b/Business/Finance/FinanceFormulas.php @@ -754,6 +754,20 @@ class FinanceFormulas return log(2) / log(1 + $r); } + /** + * Get rate to dobule + * + * @param float $t Time in which to double investment + * + * @return float + * + * @since 1.0.0 + */ + public static function getDoublingRate(float $t) : float + { + return exp(log(2) / $t) - 1; + } + /** * Doubling Time - Continuous Compounding *