lexical_cast tests failed
I was testing out lexical_cast, and I would expect that for any value v of type T, it should be true that v == lexical_cast<T>(lexical_cast<string>(v)) but this does not appear to work for float or double in all cases. In particular, the following tests failed: float value = numeric_values<float>::min(); BOOST_CHECK_EQUAL(value, lexical_cast<float>(lexical_cast<string>(value))); value = numeric_values<float>::max(); BOOST_CHECK_EQUAL(value, lexical_cast<float>(lexical_cast<string>(value))); double dvalue = numeric_values<double>::min(); BOOST_CHECK_EQUAL(dvalue, lexical_cast<double>(lexical_cast<string>(dvalue))); dvalue = numeric_values<double>::max(); BOOST_CHECK_EQUAL(dvalue, lexical_cast<double>(lexical_cast<string>(dvalue))); Should I have expected these tests to pass? thanks, --chris
participants (1)
-
Chris Surridge