Mathieu Malaterre wrote:
Hello,

I must be missing something really simple but how does one work around this :

$ cat demo.c
int main()
{
  int k = 375;
  double a = 3.75;
  k /= a;
  return 1;
}

As someone from gnu.gcc.help pointed out I can reproduce funny results with:


$ cat demo.c
int main()
{
  int k = 370;
  double a = 3.70;
  k /= a;
  return 1;
}

depending on compile option:
gcc -O0 demo.c returns 99
gcc -O1 demo.c returns 100

Someone to refresh my memory ?

Thanks
Mathieu
_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to