delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/05/23:53:40

Message-ID: <384B316E.91AE9766@snetch.cpg.com.au>
Date: Mon, 06 Dec 1999 14:45:50 +1100
From: Michael Abbott aka frEk <20014670 AT snetch DOT cpg DOT com DOT au>
Organization: Student of Computer Power Institute
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Help needed with a program I am writing
References: <dPE24.416$wM4 DOT 28044 AT news-west DOT eli DOT net> <82f61g$54c$1 AT nntp8 DOT atl DOT mindspring DOT net>
Reply-To: djgpp AT delorie DOT com

Heya

Marp wrote:

> 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.

I'm not sure about that one... Isn't * on the same level as / which means that
anything on that level gets calculated from left to right? Correct me if I'm
wrong :)

- Michael

- Raw text -


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