You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be the first example many people will look at so imho it deserves some love. Do you prefer very small grained PRs or dumping smaller things into this thread?
Anyway, the first issue that hit me is that "ln" and "log" do nothing. "ln" should be unary and adding it to the uops is straightforward and works as expected. "log" appears to be intended as binary and I can not see why it does not work.
Also the whole logic of the calculator suffers a bit from the problem that "basic" and "scientific" calculators almost always use different logic of evaluation: "basic" won't honour arithmetic precedence rules, scientific will. So it may be an idea to concentrate on the scientific branch and make it real good.
The text was updated successfully, but these errors were encountered:
I agree, the calculator needs love. I've addressed a few issues you raised in #2579, but there is still work to do. I welcome small grained PRs and we can keep general discussions here.
The calculator project was more of an excuse to test/showcase the UI system, I spent less time on the underlying logic and it has badly evolved. The scientific ops were added quickly and may very well have issues. Feel free to improve the logic or rewrite it, separating the scientific logic could be a good idea to preserve a simple behavior in the classic variant.
My priority with the calculator is to keep the UI code simple and clean, but the logic can get more complex.
I have a suggestion to implement the precedence rules (and support keyboard input as a bonus), you could use and extend the calc example of nitcc (the Nit Compiler Compiler). The calc example is basically a calculator interpreting a string: https://github.com/nitlang/nit/tree/master/contrib/nitcc/examples
This may be the first example many people will look at so imho it deserves some love. Do you prefer very small grained PRs or dumping smaller things into this thread?
Anyway, the first issue that hit me is that "ln" and "log" do nothing. "ln" should be unary and adding it to the uops is straightforward and works as expected. "log" appears to be intended as binary and I can not see why it does not work.
Also the whole logic of the calculator suffers a bit from the problem that "basic" and "scientific" calculators almost always use different logic of evaluation: "basic" won't honour arithmetic precedence rules, scientific will. So it may be an idea to concentrate on the scientific branch and make it real good.
The text was updated successfully, but these errors were encountered: