|
From: <pl...@pi...> - 2014-11-03 19:04:56
|
Hi,
I seem have a problem with NaN not propagating to function calls.
gnuplot>
integ(x)=(int_last==0)?(NaN,int_last=x):(int_last=int_last+x)
plot int_last=0, "-" u 1:(integ($2-44)) w l
input data ('e' ends) > 1 1
input data ('e' ends) > 2 2
input data ('e' ends) > 3 NaN
input data ('e' ends) > 4 4
input data ('e' ends) > 5 5
input data ('e' ends) > e
gnuplot> print int_last+NaN
NaN
This gives a straight line with a break which means that the third line
is evaluating NaN as zero and passing -44 to the function.
I was expecting the argument (NaN-44) to pass NaN to the function which
would in turn return and assign a NaN leaving all further points
unplotted.
Bug or feature ?
Regards, Peter.
|