diff options
| author | Jens Mönig <jens@moenig.org> | 2015-06-25 15:32:22 +0200 |
|---|---|---|
| committer | Jens Mönig <jens@moenig.org> | 2015-06-25 15:32:22 +0200 |
| commit | 4707169519b0d7b5f41fff46bb5c7e25a36bc498 (patch) | |
| tree | 7d57ecb2e918a78faa607327e673cc8bf282d575 | |
| parent | f4ff1056eae012b9a257c7dea88af3d007012632 (diff) | |
| parent | e21a872b0dcbca2e7ea8311d9b54f709876d1848 (diff) | |
| download | snap-4707169519b0d7b5f41fff46bb5c7e25a36bc498.tar.gz snap-4707169519b0d7b5f41fff46bb5c7e25a36bc498.zip | |
Merge pull request #834 from cycomachead/number-functions
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
@@ -1114,9 +1114,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(); |
