|
From: Ioannis V. <no...@ya...> - 2001-11-11 18:57:48
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf=20
> Of Mihkel Pajusalu
> Sent: Sunday, November 11, 2001 8:43 PM
> To: dev...@li...
> Subject: [Dev-C++] Math error
>=20
>=20
> Hello,
>=20
> I wrote a very simple programme to test function
> sin():
>=20
> #include <stdio.h>
> #include <math.h>
>=20
> void main()
> {
> float f=3D1.0f;
> printf("The sine for %f is %f",f,sin(f));
> =20
> }
> , but it printed on the screen
> "The sine for 1.00000 is 0.841471".
> Then I tried to calculate sine for 1.0000 on a
> calculator and I found that sine for 1 is 0.017452...
>=20
> What am I doing wrong?
> (I'm sorry for the spelling mistakes)
Yeah, now you said it struck strange to me too. Then i discovered that
the argument is in rads... Now i just saw that it writes this fact in my
K&R too (last sentence).
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
|