Hi.
1 | #include "stdio.h" |
2 | #include "math.h" |
3 | |
4 | float test_float=0; |
5 | __int16 test_int=0; |
6 | float Pi=3.141593; |
7 | |
8 | int main() |
9 | {
|
10 | test_float=10000*sin(2*Pi*(1200/2000)); |
11 | test_int=(int)test_float; |
12 | printf("%x",test_int); |
13 | printf("\n%x",test_float); |
14 | getchar(); |
15 | return 0; |
16 | }
|
Irgendwie gibt der Computer NULL aus, aber ich möchte, dass da -5878 bzw. -5877.852523 in der Ausgabe steht. Ich finde den Fehler nicht und die Suche hat mir auch nicht geholfen.