I just stumbled into a strange behaviour in LibreOffice Calc, which returned a false result after I evaluated a long formula. Simplifying the formula, I discovered that the problem can be resumed to inserting "-4^2" in a cell and getting a different results than inserting "0-4^2". I was quite astonished!!!
Looking for an explanation, I found this:
So in the end, the conclusion is the LibreOffice is buggy because M$ Excel is and because Calc is trying to be as compatible as possible with M$ Excel it HAS to be buggy.
This raised a general question: are all the FLOSS apps doomed to be buggy, just because famous closed-source software are? For instance, should we voluntarily introduce bugs in the Linux kernel just because Wine need to work exactly like M$'s kernel?!??
PS: For the curious ones, the operator's precedence are (quite) well defined mathematically, so YES Excel IS buggy (should I say "again"?):
https://www.youtube.com/watch?v=tYf3CpbqAVo [in French]
First of all, this is an invalid issue. Its question ("Are FLOSS doomed to be buggy because famous closed sources software are (just for the sake of compatibility)??") has nothing to do with problems that bug tracker is used for.
Then, it is wrong when (emotionally) discussing *correct* behavior of LibreOffice (and Excel). In "-4^2", the unary minus is not an operation, it is *part of mathematical notation for negative numbers*, while in "0-4^2", the minus is a binary operation that has its precedence relative to other math operations. And no, it's wrong to think that three different things (minus as part of negative number notation; minus as unary negation - as in -(2+5); and minus as binary subtraction operation) have the same rules of application / precedence. When used as part of negative number notation, it is considered prior to *any* operation you might want to apply to the negative number.
It's a different thing that users sometimes don't know math well enough; there is tdf#114929 that suggests automatic bracketing for this.