| 634 | // Requires `s` is not represented by an integral type. |
| 635 | template<class F> |
| 636 | void |
| 637 | fc(std::string const& s, F const& f) |
| 638 | { |
| 639 | char* str_end; |
| 640 | double const need = |
| 641 | std::strtod(s.c_str(), &str_end); |
| 642 | // BOOST_TEST(str_end == &s.back() + 1); |
| 643 | double const got = f(s); |
| 644 | auto same = got == need; |
| 645 | auto close = same ? |
| 646 | true : within_1ulp(got, need); |
| 647 | |
| 648 | if( !BOOST_TEST(close) ) |
| 649 | { |
| 650 | std::cerr << "Failure on '" << s << "': " << got << " != " << need << "\n"; |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | void |
| 655 | fc(std::string const& s) |