27 Jun
2003
27 Jun
'03
09:00
* Am Fre, 27 Jun 2003 schrieb Bernhard Walle:
Hallo,
folgendes Problem:
,----[ test.c ]- | #include
| #include | | int main (int argc, char** argv) | { | printf("%f\n", round(0.5)); | | return 0; | } `---- [~] $ gcc -W -Wall -Wno-unused -lm -o test test.c test.c: In function `main': test.c:6: warning: implicit declaration of function `round' test.c:6: warning: double format, different type arg (arg 2)
Das Ergebnis ist auch unbrauchbar (2.890182). Warum? round() scheint mir die einzige Funktion zu sein, die "normal" rundet, also x.5 immer nach oben.
Keine Ahnung von round, aber ich nehme immer floor(x+0.5) zum Runden... Gruß Christoph -- Christoph Maurer - Tux#194235 - christoph-maurer@gmx.de