Why some kind of expressions not working on my calculator? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Why some kind of expressions not working on my calculator?

When I input 2/5 it's fine but when I input 4/5/5 then it's error.Again I am not be able to evaluate two trigonometry expression like sin(20)+sin(70).But It make no sense as I checked the codes many times. Recommend me how to develop the codes and make this better.Thanks in advance. https://code.sololearn.com/WJ52vscdRcBS/?ref=app

15th Jul 2021, 2:34 PM
Nabid Ahammed Limon
Nabid Ahammed Limon - avatar
6 Respuestas
+ 2
Thanks for your support🥰 I just use regex replacing method instead of string.And now it works like a real Scientific Calculator 😍
16th Jul 2021, 12:57 PM
Nabid Ahammed Limon
Nabid Ahammed Limon - avatar
+ 1
But those simple expressions are working..😕 I'm taking about the trigonometry and others complex function.
16th Jul 2021, 1:39 AM
Nabid Ahammed Limon
Nabid Ahammed Limon - avatar
16th Jul 2021, 2:35 AM
blocked
+ 1
Hi, I think you'll immedialy find the problem if you look at what your code is doing. One line before `eval(f)`, insert a `console.log(f)` and then rerun your two examples. It should be obvious where things are going wrong. :)
16th Jul 2021, 6:53 AM
Schindlabua
Schindlabua - avatar
0
checked that one!But I think you should check my calculator for understanding what actually the problem is😔
16th Jul 2021, 2:52 AM
Nabid Ahammed Limon
Nabid Ahammed Limon - avatar
16th Jul 2021, 1:32 AM
blocked