Modulus Question

Tang sound-tang@jp.yamatake.com
Thu Jun 12 01:36:00 GMT 2003


Hi,

I'm running gcc 3.2-7 for Red Hat Linux 8.0.
I've come across this problem.

-- snip --
#include <stdio.h>

int main()
{
	int a = -1;
	printf("%d\n",(a % 10));
	return 0;
}
-- snip --

This printed result is -1. I think the result should be 9.
I dont have any other gcc to test this. Is this a bug?



More information about the Gcc-help mailing list