delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/01/02:14:57

From: "Carlos Giani_AEN2003 (M2003)" <DARKVALE AT pcc DOT tgm DOT ac DOT at>
Organization: TGM / PCC
To: djgpp AT delorie DOT com
Date: Mon, 1 Mar 1999 08:16:06 MET-1MDT
Subject: BUG
X-mailer: Pegasus Mail/Windows (v1.22)
Message-ID: <41E9C77ACC@pcc.tgm.ac.at>
Reply-To: djgpp AT delorie DOT com

I found a BAD bug in DJGPP.
If you say
   If (x)
     y=1;
   else
     y=2;

Then y will be 1 if x isn't 0, otherwise y will be 2.

Well, if you rewrite the above:
  y= (x) ? 1 : 2

y will ALWAYS be 1, and NEVER 2. You have to correct it to:

 y= (x!=0) ? 1 : 2

You see?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019