Thanks to each and all of you. I appreciate especially the warnings about pitfalls in the summation test; I'll remember those.
I failed to provide the limits/boundary conditions. I should have qualified the question and put it this way:
Which of these is faster to execute?
For A, B, C < 2 (and of course not negative!),
IF A+B+C=0 THEN . . .
or
IF A=0 AND B=0 AND C=0 THEN . . .
It looks as if Dave assumed the limits I had in mind.
The reason for my question was that, back in the bad old days, the syntax of conditional statements in FORTRAN IIb (sometimes called "Weather Bureau FORTRAN") was extremely limited, so doing a test like this was easier, if not necessarily faster.
I happened to try it with PBP in an application, and it worked. I just didn't know how economical it was in terms of generated code. Hence my question.
Bookmarks