| 353 | |
| 354 | template <class T> |
| 355 | static std::string classify(T x) |
| 356 | { |
| 357 | switch(std::fpclassify(static_cast<double>(x))) |
| 358 | { |
| 359 | case FP_INFINITE: return "inf"; |
| 360 | case FP_NAN: return "nan"; |
| 361 | case FP_NORMAL: return "normal"; |
| 362 | case FP_SUBNORMAL: return "subnormal"; |
| 363 | case FP_ZERO: return "zero"; |
| 364 | default: return "unknown"; |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | static void print_statistics(std::ostream& os, const argument& a) |
| 369 | { |