30.07.2011, 13:35
Do i something wrong or does divide operator work incorrect?! Here are some examples
Isnt job of print to provide me an correct output, instead of making float(10/5) etc.?
pawn Код:
printf( "%f", 5.0/8 ); // OK => 0.625000
printf( "%f", 5/8.0 ); // OK => 0.625000
printf( "%f", 5/8 ); // Wrong? => 0.000000
printf( "%d", 5/8 ); // Wrong? => 0
printf( "%d", 10/5 ); // OK => 2
printf( "%f", 10/5 ); // Wrong? => 0.000000
printf( "%f", float(10/5) ); // OK => 2.000000