[Bug target/68424] static_cast<int>(0.29 * 100) == "28"
alex.piliev at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Nov 18 22:27:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68424
--- Comment #2 from Alex Piliev <alex.piliev at gmail dot com> ---
#include <iostream>
int main(int argc, char* argv[]) {
std::cout << static_cast<int>(0.28 * 100) << std::endl;
std::cout << 0.29 * 100 << std::endl;
std::cout << static_cast<int>(0.29 * 100) << std::endl;
std::cout << static_cast<int>(0.30 * 100) << std::endl;
return 0;
}
g++ -std=c++11 -o test29 test29.cpp
More information about the Gcc-bugs
mailing list