This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Modulus Question
- From: Tang <sound-tang at jp dot yamatake dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 12 Jun 2003 10:38:39 +0900
- Subject: Modulus Question
- Reply-to: sound-tang at jp dot yamatake dot com
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?