I noticed that there is an error in the EXP formula calculation in Libreoffice Calc.

If I calculate EXP(-2^2) Calc reports 54.598 but if I calculate EXP(0-2^2) it gives the correct answer of 0.018 But they should both be 0.018. Calc does not follow BEDMAS in this instance.

Has this been noticed as a bug? Or is this by design?

Note that - in your formula is not subtraction, and even not an operation of negation, but a part of a number name - namely, the name of a negative number -2.

Interesting that I never knew that and Iâve used spreadsheets for many years for many complicated things and math programs disagree and so do programming languages:

and python is the same (disagrees with spreadsheets too)

The bad and ambiguous treatment of the âminusâ in mathematical context has a long tradition, mainly being perpetuated by bad teaching. Basically the character is used in three roles:

digit-like as the leading element when transmitting a value in a representation for the human ear or eye, but also (recoded somehow) in IT-files nowadays (case ânumber nameâ as @mikekaganski used the term),

as unary operator meaning âchange signâ (often CHS on pocket calculators),

as the binary operator for âcalculate the differenceâ.

As any âoverloaded notationâ the minus needs context-sensitive interpretation, and people tend to have a preferred approach. In the given case the first role seems to be rarely teached in a clear way, and the second and third role are treated as âbasically the sameâ using the think-around with â0 -â. Trying to consistently apply this approach to the first role would, however, require to abandon any means to communicate negative numbers as genuine entities. The actually transmitted number would always be >=0, and the minus an operator needing to be applied subsequently. I would call this an obviously inconsistent approach falling back to the times when negative numbers were disesteemed even in math.

Calc didnât go this way, but regards the first role as a relevant one. However the way it tries to implement this is inconsistent again because it requires in many cases to use parentheses to force the interpretation of another â-â as the âunaryâ operator (second role). Even the âequivalenceâ of the uinary minus with the â0 -â doesnât survive as @sikkema demonstrated.

A syntactically sufficiently clean way to resolve the siuation would be to apply the first role only if the â-â is not separated in any way from the leading character of the unsigned numeric literal following it. This canât be implemented, however, after a long time of having it done differently. And very few users will be interested in the related questions. In addition: I donât know and nobody mentioned how Excel handles the cases. I would suppose they do it the same way. And incompatibility with Excel on that level would be inacceptable for most users.
Thus: Bear with the inconsistencies.