summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/math/log.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/math/log.js')
-rw-r--r--node_modules/locutus/php/math/log.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/locutus/php/math/log.js b/node_modules/locutus/php/math/log.js
new file mode 100644
index 0000000..6846759
--- /dev/null
+++ b/node_modules/locutus/php/math/log.js
@@ -0,0 +1,12 @@
+'use strict';
+
+module.exports = function log(arg, base) {
+ // discuss at: http://locutus.io/php/log/
+ // original by: Onno Marsman (https://twitter.com/onnomarsman)
+ // improved by: Brett Zamir (http://brett-zamir.me)
+ // example 1: log(8723321.4, 7)
+ // returns 1: 8.212871815082147
+
+ return typeof base === 'undefined' ? Math.log(arg) : Math.log(arg) / Math.log(base);
+};
+//# sourceMappingURL=log.js.map \ No newline at end of file