diff options
| author | Michael Ball <cycomachead@gmail.com> | 2015-06-15 17:19:25 -0700 |
|---|---|---|
| committer | Michael Ball <cycomachead@gmail.com> | 2015-06-15 17:19:25 -0700 |
| commit | e21a872b0dcbca2e7ea8311d9b54f709876d1848 (patch) | |
| tree | 695d64b8c3134188f2cb32bcd1c2401a555b27c9 | |
| parent | 3885ced35aee903f74d48c293bc3f0665a38dba5 (diff) | |
| download | snap-e21a872b0dcbca2e7ea8311d9b54f709876d1848.tar.gz snap-e21a872b0dcbca2e7ea8311d9b54f709876d1848.zip | |
Implement log10 and 10^x math functions
| -rw-r--r-- | blocks.js | 6 | ||||
| -rw-r--r-- | threads.js | 6 |
2 files changed, 6 insertions, 6 deletions
@@ -1111,9 +1111,9 @@ SyntaxElementMorph.prototype.labelPart = function (spec) { acos : ['acos'], atan : ['atan'], ln : ['ln'], - // log : 'log', - 'e^' : ['e^'] - // '10^' : '10^' + log : ['log'], + 'e^' : ['e^'], + '10^' : ['10^'] }, true ); @@ -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(); |
