// JP opened flex table

Click to See Complete Forum and Search --> : Bug in VS 6.0 compiler?


Cut
December 6th, 2001, 10:33 PM
I'm running the following in VS 6.0 under Win2k.

When I execute the debug version everything works fine but in the release version there is bug.

-1/x generates the answer -19 ! (it should be 0)
-2/x works as it should.

Does anyone know what's going on?

#include <iostream>
using namespace std;

int main()
{
int x = 19;

cout << "x = " << x << "\n\n";
cout << "-1/x = " << -1/x << "\n";
cout << "-1/19 = " << -1/19 << "\n\n";
cout << "-2/x = " << -2/x << "\n";
cout << "-2/19 = " << -2/19 << "\n\n";

return 0;
}

/Cut

SergueiP
January 5th, 2002, 10:38 AM
realy... very strange :(

seshagiri
January 12th, 2002, 06:03 AM
hi,

I am not able to reproduce this with VC 6.0 SP2.

Seshagiri Rao

suk
January 13th, 2002, 07:20 AM
its working fine for me!!!

Plastelin
January 20th, 2002, 05:35 PM
Very strande bug! But I find some way where it could be!
This is bug of stuppid optimization copilator! If in "Project Settings" -> "C/C++" -> "Optimization" -> "Customize" sellect all options exept :"Global Optimization" and "Full Optimization" every think working just fine! But as I could see Microsoft Compiler have many sutch king bugs!

//JP added flex table