www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/12/28/06:01:58

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Posted-Date: Fri, 28 Dec 2001 11:59:08 +0100 (MET)
From: Cédric Lucantis <c DOT lucantis AT caramail DOT com>
To: DJGPP mail list <djgpp AT delorie DOT com>
Message-ID: <1009537147006533@caramail.com>
X-Mailer: Caramail - www.caramail.com
X-Originating-IP: [213.56.50.125]
Mime-Version: 1.0
Subject: Re: Modulo operator
Date: Fri, 28 Dec 2001 11:59:07 GMT+1
Reply-To: djgpp AT delorie DOT com

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--=_NextPart_Caramail_0065331009537147_ID
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


> -------Message d'origine-------
> De : Greg & Steph <gswhite AT xtra DOT co DOT nz>
> Date : 27/12/2001 22:45:52
> 
> Gidday,
> All my books for c & c++ use 0.000000or modulo
> ie
> mod=3Dcount;
> 
> gives, mod=3D0 for even count
> and, mod=3D1 for odd count
> 
> this dosen't work with rhide/djgpp (!?!)
> or, can't I work with rhide/djgpp ?!!
> 
> Can any one point me right???
> 
> Thanx,
> Greg
> 
> 
Hi
I can't help without more explanations, but I can tell the 
modulo operator is the same in DJGPP compiler as in others 
(%). I often used it (with DJGPP and Emacs, but the IDE 
should not have any importance) and never had any problem. 
I think you have another bug in your program. Here is a 
little to demonstrate its use :

int main() {
 int i;
 for(i=3D0; i<10; i++) {
 printf("%d\n", i%2);
 }
 return 0;
}

and the output is :
0
1
0
1
0
...


______________________________________________________
Bo=EEte aux lettres - Caramail - http://www.caramail.com


--=_NextPart_Caramail_0065331009537147_ID--

- Raw text -


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