Hallo, ich will folgendes machen:
1 | int16_t x, y, z; |
2 | |
3 | x = 29; |
4 | y = -260; |
5 | z = 20; |
6 | |
7 | //ausgabe auf RS232
|
8 | put_string(itoa(sqrt((x^2)+(y^2)+(z^2)), msg, 10)); |
Da kommt nicht das Richtige raus. Das ist ein Problem mit dem Überlauf, richtig? Versuchsweise:
1 | //ausgabe auf RS232
|
2 | put_string(itoa((x^2)+(y^2)+(z^2), msg, 10)); |
Ausgabe: -206 Wie mache ich das richtig? (Atmega 8) Tschüss muebau