delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/05/21:38:34

From: "Marp" <Marp AT 0 DOT 0 DOT 0 DOT 0>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help needed with a program I am writing
Date: Sun, 5 Dec 1999 21:16:34 -0500
Organization: MindSpring Enterprises
Lines: 13
Message-ID: <82f61g$54c$1@nntp8.atl.mindspring.net>
References: <dPE24.416$wM4 DOT 28044 AT news-west DOT eli DOT net>
NNTP-Posting-Host: c7.b7.cf.2e
X-Server-Date: 6 Dec 1999 02:12:00 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

P K <paulkennedy AT citlink DOT net> wrote in message
news:dPE24.416$wM4 DOT 28044 AT news-west DOT eli DOT net...
<snip>

>     cos_table[a]=cos((float)a/180 * pi);
>     sin_table[a]=sin((float)a/180 * pi);

I'm not sure why you get the error you do, but you want the a/180 to be
calculated first, right? You have to surround that with parenthesis
otherwise the 180 * pi gets calculated first (order of operations) and you
get a different number from the one you want.


- Raw text -


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