Opened 7 years ago
Closed 7 years ago
#11554 closed Bugs (wontfix)
lexical_cast<string>(124.4)
Reported by: | anonymous | Owned by: | Antony Polukhin |
---|---|---|---|
Milestone: | To Be Determined | Component: | lexical_cast |
Version: | Boost 1.57.0 | Severity: | Problem |
Keywords: | Cc: |
Description
#include <string> #include <iostream>
using std::cout; using std::endl; using std::string;
int _tmain(int argc, _TCHAR* argv[]) {
using boost::lexical_cast;
string out = lexical_cast<string>(124.4); cout << "out = " << out << endl; system("pause");
return 0;
}
Change History (3)
comment:1 by , 7 years ago
Component: | None → lexical_cast |
---|---|
Owner: | set to |
comment:2 by , 7 years ago
comment:3 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Floating point types have no exact representation. See #5796 for more details and in-depth description.
Note:
See TracTickets
for help on using tickets.
What's the bug?
You're aware that 124.4 has no exact binary representation and so you will not get "124.4" printed out?