Revision 92782e4a
Added by David Sorber over 4 years ago
| software/fixed/parse_test.cc | ||
|---|---|---|
|
|
||
|
long double value = 0.0;
|
||
|
fixed_64_64 fvalue;
|
||
|
//~ fixed_128_128 f128value;
|
||
|
|
||
|
// 0) strtold()
|
||
|
if (parseType == 0)
|
||
| ... | ... | |
|
<< " ms" << std::endl;
|
||
|
}
|
||
|
#endif
|
||
|
#if 0
|
||
|
// 5)
|
||
|
else if (parseType == 5)
|
||
|
{
|
||
| ... | ... | |
|
auto start = std::chrono::system_clock::now();
|
||
|
for (auto& strValue : values)
|
||
|
{
|
||
|
fvalue.parse(strValue.c_str());
|
||
|
//~ std::cout << "In: " << strValue << " -- Out: " << fvalue << std::endl;
|
||
|
f128value.parse(strValue.c_str());
|
||
|
std::cout << "In: " << strValue << " -- Out: " << f128value << std::endl;
|
||
|
}
|
||
|
auto end = std::chrono::system_clock::now();
|
||
|
auto diff = end - start;
|
||
| ... | ... | |
|
<< " ms" << std::endl;
|
||
|
|
||
|
}
|
||
|
#endif
|
||
|
else
|
||
|
{
|
||
|
std::cerr << "ERROR: invalid parse type: " << parseType << std::endl;
|
||
Additional improvements to the fixed type. Also added a few good test
cases.