Skip to content

search-provider: stop normalizing the equation twice

When an equation is given by the g-s overview, g-c will solve this equation, where it will be first normalized and then solved. This is done by running a subprocess, where g-c will call g-c in this subprocess with the "--solve" argument. With this "--solve" argument, the equation will also be normalized. However, when an equation is given by the g-s overview, it will also be normalized in a check, that happens before the solve process, to not to process single numbers given by the g-s overview. This normalized equation will then be used to invoke the subprocess to solve the equation, leading into normalizing the already normalized equation and therefore resulting into wrong results when the equation itself contains decimal numbers.

Solve this issue, by invoking the subprocess with the unnormalized equation, instead of the normalized one, to not to normalize the equation twice.

Closes: #104 (closed)

I hope the commit message is alright and does not contain any wrong information. It seems that running g-c with --solve over the command line shows the correct result and the search provider makes use of this option. I don't know why it worked before commit 2bd8ecb2 with the normalized equation, maybe due to a side effect somewhere, but it seems to work now as intended, at least in my locale.

I didn't checked other locales, where the 'point' is used as decimal separator, but I think it should work there, too.

Merge request reports