delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/12/06:54:35

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: math.h sin() function returns wrong value
Date: Fri, 11 Jul 1997 00:34:46 -0400
Organization: Cornell University http://www.cornell.edu
Lines: 39
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <33C5B7E6.7761@cornell.edu>
References: <01bc8d93$99a3f7a0$2a39868b AT dgmdavies>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: cu-dialup-0036.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Gareth Davies wrote:
> 
> I'm pretty new to C, and this has really got me stuffed.  Can anybody 
> give me a hand?
... snip ...
> but the sin() function has been returning weird values.

> void main()

no no and no again: int main(void)

... snip ...

>   printf("sin(45) = %f\n", sin(45));

... snip ...

> Do I need to get djgpp version 3?  At the moment, I've got version 2.

no.

in ANSI C, the trigonometric functions take the angle in RADIANS as
their argument.

why can't people just assume that they are doing something wrong rather
than assuming that it is the library function that is at fault? when my
programs crash, i first look at _my_ code.

-- 
   Sinan
 
*******************************************************************
 A. Sinan Unur                                WWWWWW
                                              |--O+O
 mailto:sinan DOT unur AT cornell DOT edu                C   ^ 
 http://www.people.cornell.edu/pages/asu1/     \  ~/ 

Unsolicited e-mail is _not_ welcome, and will be billed for.
*******************************************************************

- Raw text -


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