Hello,
I'm trying to do something like below,
float realValue = 5.2;
float nanValue = NAN;
qDebug()<<"realValue"<<round(realValue)<<"nanValue"<<round(nanValue);
float realValue = 5.2;
float nanValue = NAN;
qDebug()<<"realValue"<<round(realValue)<<"nanValue"<<round(nanValue);
To copy to clipboard, switch view to plain text mode
Output in Linux:
realValue 5 nanValue -2147483648
realValue 5 nanValue -2147483648
To copy to clipboard, switch view to plain text mode
Here for NAN value, it's giving negative value. Is there any alternative for this or how should I handle this in Linux?
I'm using these values to set the size of variable and size cannot be negative nor NAN.
Again, if anyhow I tried to figure out NAN value, then added with NAN value is always NAN.
qDebug()<<"Output is: "<<(NAN+90)
//Output:
Output is: NAN
qDebug()<<"Output is: "<<(NAN+90)
//Output:
Output is: NAN
To copy to clipboard, switch view to plain text mode
Thanks
Bookmarks