This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Modulus Question


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]