El 29/03/2006, a las 14:39, Hrvoje Niksic escribió:

I can't see any good reason to use "," here. Why not write the line
as:
      eta_hrs = eta / 3600; eta %= 3600;

Because that's not equivalent.

Well, it should be, because the comma operator has lower precedence
than the assignment operator (see http://tinyurl.com/evo5a,
http://tinyurl.com/ff4pp and numerous other locations).

Indeed you are right. So:

eta_hrs = eta / 3600, eta %= 3600;

Is equivalent to the following (with explicit parentheses to make the effect of the precendence obvious):

(eta_hrs = eta / 3600), (eta %= 3600);

Or of course:

eta_hrs = eta / 3600; eta %= 3600;

Greg

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to