#include <cfloat>
#include <cmath>
#include <iostream>
using namespace std;
auto classify(double x) {
switch (std::fpclassify(x)) {
case FP_INFINITE: return "Inf";
case FP_NAN: return "NaN";
case FP_NORMAL: return "normal";
case FP_SUBNORMAL: return "subnormal";
case FP_ZERO: return "zero";
default: return "unknown";
}
}
int main() {
double x = DBL_MIN;
cout << "DBL_MIN is " << classify(x) << endl;
cout << x << ": " << (x > 0) << endl;
cout << x * x << ": " << "DBL_MIN * DBL_MIN is " << classify(x * x) << endl;
cout << (x * x > 0) << endl;
return 0;
}
I2luY2x1ZGUgPGNmbG9hdD4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgphdXRvIGNsYXNzaWZ5KGRvdWJsZSB4KSB7CiAgICBzd2l0Y2ggKHN0ZDo6ZnBjbGFzc2lmeSh4KSkgewogICAgICAgIGNhc2UgRlBfSU5GSU5JVEU6IHJldHVybiAiSW5mIjsKICAgICAgICBjYXNlIEZQX05BTjogcmV0dXJuICJOYU4iOwogICAgICAgIGNhc2UgRlBfTk9STUFMOiByZXR1cm4gIm5vcm1hbCI7CiAgICAgICAgY2FzZSBGUF9TVUJOT1JNQUw6IHJldHVybiAic3Vibm9ybWFsIjsKICAgICAgICBjYXNlIEZQX1pFUk86IHJldHVybiAiemVybyI7CiAgICAgICAgZGVmYXVsdDogcmV0dXJuICJ1bmtub3duIjsKICAgIH0KfQoKaW50IG1haW4oKSB7Cglkb3VibGUgeCA9IERCTF9NSU47Cgljb3V0IDw8ICJEQkxfTUlOIGlzICIgPDwgY2xhc3NpZnkoeCkgPDwgZW5kbDsKCWNvdXQgPDwgeCA8PCAiOiAiIDw8ICh4ID4gMCkgPDwgZW5kbDsKCWNvdXQgPDwgeCAqIHggPDwgIjogIiA8PCAiREJMX01JTiAqIERCTF9NSU4gaXMgIiA8PCBjbGFzc2lmeSh4ICogeCkgPDwgZW5kbDsKCWNvdXQgPDwgKHggKiB4ID4gMCkgPDwgZW5kbDsKCXJldHVybiAwOwp9