double
math_step(double x)
{
/*
* Calculate step function value.
*/
return (x < 0) ? 0 : 1;
}
of course gives step(nan)=1.
Alex, what's your opinion? And what about
double
math_step(double x)
{
/*
* Calculate step function value.
*/
return isnan(x) ? x : ( x < 0 ? 0 : 1 );
}
G.
--
Giulio Bottazzi <
address@hidden>
PGP Key ID:BAB0A33F