jiggzson / nerdamer

a symbolic math expression evaluator for javascript
http://www.nerdamer.com
MIT License
517 stars 82 forks source link

in line 10052, there should be input[2] instead of input[1] (printing log(x, y)) #575

Closed michalmicpaw closed 3 years ago

michalmicpaw commented 4 years ago

Hello.

I've found logical error in your code. In line 10052: You need to change line:

v[index] = '\\mathrm' + this.braces(Settings.LOG) + '_' + this.braces(input[1]) + this.brackets(input[0]);

to

v[index] = '\\mathrm' + this.braces(Settings.LOG) + '_' + this.braces(input[2]) + this.brackets(input[0]);

cause it prints comma instead of number at floor level.

Thanks ;)

jiggzson commented 3 years ago

@michalmicpaw, can you give me an example of what this fixes? When I update this line and type in nerdamer('log(x,y)').toTeX(), I now get \mathrm{log}_{undefined}\left(x\right) instead of \mathrm{log}_{y}\left(x\right)