Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

sin() and cos()... wtf? (c++)

Name: Anonymous 2006-09-04 0:32

Check this out:

double direction, length, result1, result2;
out << "direction?\n";
cin >> direction;
result1 = cos(direction);
result2 = sin(direction);
cout << result1 << "\n";
cout << result2 << "\n";
This code is fucked up, because when I enter 45, it should return the same value (.70786 or something similar).  Instead, I get:

0.525322 (cos)
0.850904 (sin)

It's almost like the C++ library is fucked up or something.  I know I haven't forgotten basic geometry (windows calculator bears this out) and I don't think I'm going insane, so WHAT AM I DOING WRONG?

Name: Anonymous 2006-09-09 14:44

Yes. I'm an assembly programmer. So? I don't see a problem. I embraced my mnemonics long ago and I am happy together with my assembler (which allows macros - who needs functions?). We have a fucking lot of documentations of ABIs in and outside of the kernel and I can do anything I want as long as I build it from the ground up.

But thanks anyway asshole. Go and beat off to your stupid libc while I constantly reinvent the wheel.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List