Re: C: Dividieren

Andre Heine <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Moin moin,

Am Freitag, 1. Oktober 2004 00:14 schrieb volker wirth:
> float z = (1 / 2);
> printf("%f", z);
>
> und er sagt mir: 0.000000
> Danke fÃŒr die Hilfe, habe wahrscheinlich ein ziemlich großes
> Brett vorm Kopf,

Mach mal so:

float z = 1;
float r = 2;

z = z/r;

printf("%2.3\n",z);

Ciao

Andre

-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfÃŒgbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.