N
none
When I do:
#include <vector>
#include <iostream>
....
std::vector<float> vec;
vec.push_back(2.2);
vec.push_back(2.3);
std::cout << vec[0] << std::endl;
std::cout << vec[1] << std::endl;
I get:
2.2000000476837158203125
2.2999999523162841796875
what goes on with the precision? I have not specified std::setprecision anywhere. I compile and run
the code on Ubuntu 9.04.
#include <vector>
#include <iostream>
....
std::vector<float> vec;
vec.push_back(2.2);
vec.push_back(2.3);
std::cout << vec[0] << std::endl;
std::cout << vec[1] << std::endl;
I get:
2.2000000476837158203125
2.2999999523162841796875
what goes on with the precision? I have not specified std::setprecision anywhere. I compile and run
the code on Ubuntu 9.04.