From 27645c234a6f24a0759b0f7e11e307a12ea82ca0 Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Sun, 11 May 2014 01:54:15 -0700 Subject: [PATCH] [CHORE] Currency: JavaScript has Math.exp for e^x, so we should use it. --- src/js/ripple/currency.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/ripple/currency.js b/src/js/ripple/currency.js index 566be643..2e812b30 100644 --- a/src/js/ripple/currency.js +++ b/src/js/ripple/currency.js @@ -179,7 +179,7 @@ Currency.prototype.get_interest_at = function (referenceDate) { referenceDate = utils.fromTimestamp(referenceDate.getTime()); } - return Math.pow(Math.E, (referenceDate - this._interest_start) / this._interest_period); + return Math.exp((referenceDate - this._interest_start) / this._interest_period); }; // XXX Currently we inherit UInt.prototype.is_valid, which is mostly fine.