Switch case format

Hello,

I encountered an intriguing use of the switch / case statements and i'm wondering if it's a bug or if it's actually an alternative format? And which one is recommended?

case 'a': a=a-0.02**,**
Serial.print(a);
break;

But shouldn't it be the following, with a semicolon at the end, instead of a comma?

case 'a': a=a-0.02**;**
Serial.print(a);
break;

In Arduino IDE 1.8.9, i get no errors on both when verifying. But on Arduino - SwitchCase it is shown that the format should be as in the second example.

It’s not a bug that it compiles, look up the C comma operator.

It’s inappropriate in this case, so it’s probably intended to be a semi-colon instead.

Another good reason to put separate expressions on separate lines.
Nothing ‘wrong’ here, but it makes the code more obvious, and readable.
Te comma operation here is irregular and subtle, but nonetheless ‘legal’.

Consider
a = a-0.02, Serial.print(a);...remember the value returned by println() is the number bytes written.

Since the switch/case block is controlled by integral data types and 'a' controls the case, what does a = a - 0.02 yield?

econjack:
Since the switch/case block is controlled by integral data types and ‘a’ controls the case, what does a = a - 0.02 yield?

‘a’ is a value , the a in a=a=0.02 is a variable, the actual variable compared in the ‘switch’ is not stated.