Merge pull request #834 from cycomachead/number-functions

Implement log10 and 10^x math functions
pull/3/merge
Jens Mönig 2015-06-25 15:32:22 +02:00
commit 4707169519
2 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -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
);

Wyświetl plik

@ -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();