delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/19/15:00:43

Message-ID: <002301be2b8a$37ab3180$08034ac3@oemcomputer>
From: "=?iso-8859-1?Q?Veli-Pekka_Kilpel=E4inen?=" <vpk2 AT sci DOT fi>
To: <djgpp AT delorie DOT com>
Subject: Variable malfunction?
Date: Sat, 19 Dec 1998 22:00:18 +0200
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

Tämä on moniosainen MIME-muotoinen viesti.

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

What can be the reason when my variable is not changed in the following =
code:
=20
...
const double pi2 =3D 6.2831853072;
...
main(){}
...
void set_trigs(void)
{double gr;
for (int index =3D 0; index < 8192; index++)
 {gr =3D index / 8192 * pi2;        // gr is always zero!
 *tr++ =3D sin(gr);
 *tr++ =3D cos(gr);};}
...
=20
I see this in both Rhide's debugger and on screen. None of the Rhide's =
optimization flags are set, so no optimization should be used(everything =
else is also on default). I run Rhide at Win98 DOS mode(not prompt) and =
everything else seems working.

------=_NextPart_000_0020_01BE2B9A.F74E14C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT color=3D#000000 size=3D2>What can be the reason when my =
variable is not=20
changed in the following code:</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>...<BR>const double pi2 =3D=20
6.2831853072;<BR>...<BR>main(){}<BR>...<BR>void =
set_trigs(void)<BR>{double=20
gr;<BR>for (int index =3D 0; index &lt; 8192; index++)<BR>&nbsp;{gr =3D =
index / 8192=20
* pi2;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // gr is always=20
zero!<BR>&nbsp;*tr++ =3D sin(gr);<BR>&nbsp;*tr++ =3D =
cos(gr);};}<BR>...</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I see this in both Rhide's debugger =
and on=20
screen. None of the Rhide's optimization flags are set, so no =
optimization=20
should be used(everything else is also on default). I run Rhide at Win98 =
DOS=20
mode(not prompt) and everything else seems=20
working.</FONT></DIV></DIV></BODY></HTML>

------=_NextPart_000_0020_01BE2B9A.F74E14C0--

- Raw text -


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