View Single Post
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: finding the smallest number

 
0
  #8
Nov 13th, 2006
Originally Posted by paradox814 View Post
actually many compilers (including mine) will let you do it, even though it is considered bad form.
I've never heard of a compiler that will insert expressions in like that. Maybe I'm just ignorant. But I certainly wouldn't want that, because although a statement like this:
if (myvar == 4 || 5) { ...
might translate into:
if (myvar == 4 || myvar == 5) { ...

I certainly don't want
if (myvar == 4 || myothervar) {...
to turn into
if (myvar == 4 || myvar == myothervar) {...

Because who's to say that I didn't want to see if myvar is equal to 4 or myothervar is a nonzero value?
"Technological progress is like an axe in the hands of a pathological criminal."

All my posts may be freely redistributed under the terms of the MIT license.
Reply With Quote