Carlo Sogono wrote: > int main() { > float a = 8.0, b = 0.45, res; > > res = a + b; > printf("%f\n", res);
Printf without formatting args assumes that you want to round/truncate the value at 6 decimal places. Replacing the above printf with something like: printf ("%20.18f\n", res) ; will give C the same result as Python. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ "Islam isn't in America to be equal to any other faith, but to become dominant. The Koran should be the highest authority in America, and Islam the only accepted religion on earth." -- Omar Ahmad, board chairman of Council of American Islamic Relations to an islamic audience in 1998. _______________________________________________ coders mailing list coders@slug.org.au http://lists.slug.org.au/listinfo/coders