SpeedCrunch
111–120 of 138 posts
Re: SpeedCrunch
#112SpeedCrunch looks very promising, and I've used it a lot in the past. I'm sad to see that they still haven't released the order of operations bug fix [0] they made in 2017. SpeedCrunch does some operations in an order most people wouldn't expect. For example, SpeedCrunch says 1/2(-9.8) = -0.05102040816326530612 [0] - https://bitbucket.org/heldercorreia/speedcrunch/commits/ac49...
In a CFG this is easy enough to express. Here's an untested and at any rate incomplete CFG demonstrating the technique:
expr ::= term | term "+" expr | term "-" expr
term ::= quotient | product
quotient ::= atom "/" atom | atom "/" quotient
product ::= atom product | atom "*" product | atom
atom ::= number | variable | "-" atom | "(" expr ")"
But typical parser generators don't give you an easy way to provide a useful error message there.That version of the grammar, btw, avoids left recursion, so it ought to work as a PEG, but at the cost of the wrong associativity for "/" and "-". You either need to use left recursion or restructure the syntax tree afterwards.
Re: SpeedCrunch
#113SpeedCrunch looks very promising, and I've used it a lot in the past. I'm sad to see that they still haven't released the order of operations bug fix [0] they made in 2017. SpeedCrunch does some operations in an order most people wouldn't expect. For example, SpeedCrunch says 1/2(-9.8) = -0.05102040816326530612 [0] - https://bitbucket.org/heldercorreia/speedcrunch/commits/ac49...
Re: SpeedCrunch
#114Re: SpeedCrunch
#115SpeedCrunch looks very promising, and I've used it a lot in the past. I'm sad to see that they still haven't released the order of operations bug fix [0] they made in 2017. SpeedCrunch does some operations in an order most people wouldn't expect. For example, SpeedCrunch says 1/2(-9.8) = -0.05102040816326530612 [0] - https://bitbucket.org/heldercorreia/speedcrunch/commits/ac49...
You could make 1/2x where x = 4 evaluate to either 2 or 0.125, but either choice will have surprising results in some cases or to some people. Perhaps a better choice, especially for an interactive calculator, is to adopt partially ordered operator precedence, and reject the expression as ambiguous. Then the user can insert parentheses to disambiguate. In a CFG this is easy enough to express. Here's an untested and a…
Ouch, you just made me think that if I see this equation just "horizontally" like it's presented here, I would say 2. But if I imagine it like you would write it on paper, I would answer 0.125.
Re: SpeedCrunch
#116Earlier quoted context omitted.
Emacs Calc (not unlike much of the rest of Emacs) is a little ... special. By default, it calculates 4/2*2 as 1, because multiplication has a higher precedence than division. https://orgmode.org/manual/Formula-syntax-for-Calc.html
You could open an issue. Seems like a reasonable idea to fix that.
Re: SpeedCrunch
#117I used to use this back when I mained Windows. Ever since moving primarily to Linux, and getting familiar with Emacs, Calc mode simply beats every calculator I've ever used in total functionality. However, there are certain cases where I also like to use https://insect.sh if lots of units are involved.
(Just tried, and it works again in Google, after not working for a few years)
edit: Spotlight now has it as well. Congratulations to Apple & I need to move the goalpost.
Re: SpeedCrunch
#118Earlier quoted context omitted.
Except maybe that long histories create noticeable lag, that is.
Looking at its inner working seems it's uses SQLite as storing. While a few hundred entries in any SQLite DB should be a breeze to parse and show under a second, maybe the person(s) involved in this project are not that DB proficient and made some rookie mistakes. Maybe they'll notice this and improve it's history speed as well, shouldn't be a problem for any SQL developer with a bit of experience in hands.
Re: SpeedCrunch
#119SpeedCrunch looks very promising, and I've used it a lot in the past. I'm sad to see that they still haven't released the order of operations bug fix [0] they made in 2017. SpeedCrunch does some operations in an order most people wouldn't expect. For example, SpeedCrunch says 1/2(-9.8) = -0.05102040816326530612 [0] - https://bitbucket.org/heldercorreia/speedcrunch/commits/ac49...
You could make 1/2x where x = 4 evaluate to either 2 or 0.125, but either choice will have surprising results in some cases or to some people. Perhaps a better choice, especially for an interactive calculator, is to adopt partially ordered operator precedence, and reject the expression as ambiguous. Then the user can insert parentheses to disambiguate. In a CFG this is easy enough to express. Here's an untested and a…
Re: SpeedCrunch
#120I used to use this back when I mained Windows. Ever since moving primarily to Linux, and getting familiar with Emacs, Calc mode simply beats every calculator I've ever used in total functionality. However, there are certain cases where I also like to use https://insect.sh if lots of units are involved.
I use calc as well, especially practical in combination with guake ( a drop-down quake style console: https://github.com/Guake/guake ).