#include <limits>
#include <cstdio>
int main(int argc, char* argv[]) {
float qNaN = std::numeric_limits<float>::quiet_NaN();
float neg = -qNaN;
float sub1 = 6.0f - qNaN;
float sub2 = qNaN - 6.0f;
float sub3 = qNaN - qNaN;
float add1 = 6.0f + qNaN;
float add2 = qNaN + qNaN;
float div1 = 6.0f / qNaN;
float div2 = qNaN / 6.0f;
float div3 = qNaN / qNaN;
float mul1 = 6.0f * qNaN;
float mul2 = qNaN * qNaN;
printf(
"neg: %f\nsub: %f %f %f\nadd: %f %f\ndiv: %f %f %f\nmul: %f %f\n",
neg, sub1,sub2,sub3, add1,add2, div1,div2,div3, mul1,mul2
);
return 0;
}
I2luY2x1ZGUgPGxpbWl0cz4KI2luY2x1ZGUgPGNzdGRpbz4KCmludCBtYWluKGludCBhcmdjLCBjaGFyKiBhcmd2W10pIHsKCWZsb2F0IHFOYU4gPSBzdGQ6Om51bWVyaWNfbGltaXRzPGZsb2F0Pjo6cXVpZXRfTmFOKCk7CgoJZmxvYXQgbmVnID0gLXFOYU47CgoJZmxvYXQgc3ViMSA9IDYuMGYgLSBxTmFOOwoJZmxvYXQgc3ViMiA9IHFOYU4gLSA2LjBmOwoJZmxvYXQgc3ViMyA9IHFOYU4gLSBxTmFOOwoKCWZsb2F0IGFkZDEgPSA2LjBmICsgcU5hTjsKCWZsb2F0IGFkZDIgPSBxTmFOICsgcU5hTjsKCglmbG9hdCBkaXYxID0gNi4wZiAvIHFOYU47CglmbG9hdCBkaXYyID0gcU5hTiAvIDYuMGY7CglmbG9hdCBkaXYzID0gcU5hTiAvIHFOYU47CgoJZmxvYXQgbXVsMSA9IDYuMGYgKiBxTmFOOwoJZmxvYXQgbXVsMiA9IHFOYU4gKiBxTmFOOwoKCXByaW50ZigKCQkibmVnOiAlZlxuc3ViOiAlZiAlZiAlZlxuYWRkOiAlZiAlZlxuZGl2OiAlZiAlZiAlZlxubXVsOiAlZiAlZlxuIiwKCQluZWcsIHN1YjEsc3ViMixzdWIzLCBhZGQxLGFkZDIsIGRpdjEsZGl2MixkaXYzLCBtdWwxLG11bDIKCSk7CgoJcmV0dXJuIDA7Cn0=