summaryrefslogtreecommitdiff
path: root/threads.js
diff options
context:
space:
mode:
authorMichael Ball <cycomachead@gmail.com>2015-06-15 17:19:25 -0700
committerMichael Ball <cycomachead@gmail.com>2015-06-15 17:19:25 -0700
commite21a872b0dcbca2e7ea8311d9b54f709876d1848 (patch)
tree695d64b8c3134188f2cb32bcd1c2401a555b27c9 /threads.js
parent3885ced35aee903f74d48c293bc3f0665a38dba5 (diff)
downloadsnap-e21a872b0dcbca2e7ea8311d9b54f709876d1848.tar.gz
snap-e21a872b0dcbca2e7ea8311d9b54f709876d1848.zip
Implement log10 and 10^x math functions
Diffstat (limited to 'threads.js')
-rw-r--r--threads.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/threads.js b/threads.js
index 165ad0e..61b5722 100644
--- a/threads.js
+++ b/threads.js
@@ -2122,14 +2122,14 @@ Process.prototype.reportMonadic = function (fname, n) {
case 'ln':
result = Math.log(x);
break;
- case 'log':
- result = 0;
+ case 'log': // base 10
+ result = Math.log(x) / Math.LN10;
break;
case 'e^':
result = Math.exp(x);
break;
case '10^':
- result = 0;
+ result = Math.pow(10, x);
break;
default:
nop();