CALCULATE Rejects Leading Plus-Sign

CALCULATE(1+1) works.

CALCULATE(-1+1) works.

But CALCULATE(+1+1) fails, as does plain old CALCULATE(+1).

Hardly a show-stopper; easy to work around. But…Why???

Edited to add:

Checking further, I see that the leading plus sign seems to be rejected in other (all?) calculation contexts, including %Calculate% and Set Variable to Calculation.

And edited again to add:

I think I may have found the bottom of the rabbit hole: "+" can only be used as a binary operator, not as a unary sign. Whereas "-" may be used as either. Hence:

CALCULATE(1--1) is OK (and even CALCULATE(1------1)) but not CALCULATE(1++1).

With that understanding, I guess it all makes sense, and even explicitly documented at manual:Calculations [Keyboard Maestro Wiki]

Steve

2 Likes

Keyboard Maestro’s calculation engine does not support unary +.

2 Likes