this code should compute sin(x+y) but give wrong answer
can you help me to fix this code
thanks
can you help me to fix this code
thanks
Attachments
-
349 bytes Views: 26
Last edited:
how can i enter angles in degree1) Are you entering angles in degrees or radians?
2) Why are you computing x/pi and y/pi?
3) Why not just add x and y?
can you please run this code and see why give wrong answerBy typing in a number?
thanks for respecting othersHe he reminds of this Dilbert video
http://www.youtube.com/watch?v=L0A9Gvk2cUk
Why define pi to twice as many sig figs as a double can represent?const double pi=3.1415926535897932384626433832795;
Or more specifically, why not use the constant M_PI which is already in math.h?Why define pi to twice as many sig figs as a double can represent?
Why define pi to twice as many sig figs as a double can represent?
Or more specifically, why not use the constant M_PI which is already in math.h?
Lazyness is a reasonable excuse in situations like this -- and your rationalle is just fine.because i was too lazy and just pasted the value from calculator. also since I am working with variety of languages, I know that constant was defined somewhere in the math library but I didn't use it in a while (at least not in C) so I didn't bother to look it up. he just asked for something that works or compiles and that is what i did. happy...?