L
LTO
What is going on with MS VC compiler team? The following trivial program
will give wrong answer of 9 instead of 10. Perhaps MS is spending too much
time on managed world and forget about the real world. If we can not
multiply two numbers and get a right answer, what good is it ?
// test_int.cpp : Defines the entry point for the console application.
// the program will give wrong answer for ftemp=0.01,0.02,0.03,0.04
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int itemp;
float ftemp = 0.01f;
cout << ftemp*1000.f << endl;
cout << int(ftemp*1000.f) << endl;
cin >> itemp;
return 0;
}
will give wrong answer of 9 instead of 10. Perhaps MS is spending too much
time on managed world and forget about the real world. If we can not
multiply two numbers and get a right answer, what good is it ?
// test_int.cpp : Defines the entry point for the console application.
// the program will give wrong answer for ftemp=0.01,0.02,0.03,0.04
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int itemp;
float ftemp = 0.01f;
cout << ftemp*1000.f << endl;
cout << int(ftemp*1000.f) << endl;
cin >> itemp;
return 0;
}