Dividing numbers that will result a float ?
#5

Let the compiler know that you want float result, by setting at least one constant to float:


pawn Код:
printf("%.2f", 2.0 / 10);
(the precision format (.2 part) is not required for this to work)
Reply


Messages In This Thread
Dividing numbers that will result a float ? - by Ahmad45123 - 08.01.2015, 19:10
Re: Dividing 'undividable' numbers ? - by HY - 08.01.2015, 19:12
Re: Dividing 'undividable' numbers ? - by Ahmad45123 - 08.01.2015, 19:13
Re: Dividing numbers that will result a float ? - by CoaPsyFactor - 08.01.2015, 19:17
Re: Dividing numbers that will result a float ? - by Misiur - 08.01.2015, 19:17
Re: Dividing numbers that will result a float ? - by CoaPsyFactor - 08.01.2015, 19:19

Forum Jump:


Users browsing this thread: 1 Guest(s)