kopia lustrzana https://github.com/backface/turtlestitch
Merge pull request #834 from cycomachead/number-functions
Implement log10 and 10^x math functionspull/3/merge
commit
4707169519
|
@ -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();
|
||||
|
|
Ładowanie…
Reference in New Issue