[CHORE] Currency: JavaScript has Math.exp for e^x, so we should use it.

This commit is contained in:
Stefan Thomas
2014-05-11 01:54:15 -07:00
parent 473d8a8d8c
commit 27645c234a

View File

@@ -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.