Mail Archives: djgpp/1998/05/31/15:17:26
Seawolf schrieb in Nachricht <35715A2E DOT A9A35953 AT net4you DOT co DOT at>...
>Do you know this one?
>Try it out :-)
>
>void main( void)
>{
> float f;
> f = 55 / 77;
> printf( "%f", f);
>}
>/* and please mail me YOUR results */
it could be that zero as a result is correct, although i was a bit
surprised too. but it's no bug in DJGPP.
what you want is 55.0/77.0, this gives you 0.714...
without the .0, in C/C++ a number is always treated as an integer
it seems.
Elias Pschernig
- Raw text -