F
fl
Hi,
I encounter NaN often in Matlab. Recently, I use Matlab to generate
some code for an embedded project. I get the following source code
from Matlab below dot line.
I don't understand the line:
c_y = (b_u != b_u);
Could you explain it to me? More specific, what result can get
from: (b_u != b_u);?
How does it relate to NaN?
Thanks a lot.
BTW, real_T and boolean_T just like int and bool in C I think.
.................................
real_T b_u0;
real_T b_u;
boolean_T c_y;
b_u0 = (real_T)Idata;
b_u = b_u0;
c_y = (b_u != b_u);
if (c_y) {
d_y = rtNaN;
} else {
d_y = b_u0 * b_u0;
}
..............
I encounter NaN often in Matlab. Recently, I use Matlab to generate
some code for an embedded project. I get the following source code
from Matlab below dot line.
I don't understand the line:
c_y = (b_u != b_u);
Could you explain it to me? More specific, what result can get
from: (b_u != b_u);?
How does it relate to NaN?
Thanks a lot.
BTW, real_T and boolean_T just like int and bool in C I think.
.................................
real_T b_u0;
real_T b_u;
boolean_T c_y;
b_u0 = (real_T)Idata;
b_u = b_u0;
c_y = (b_u != b_u);
if (c_y) {
d_y = rtNaN;
} else {
d_y = b_u0 * b_u0;
}
..............