delete trailing whitespace
add step function definition

The specified definition has same behavior as R bultiin stepfun,
so it can be easier for debugging and porting R code to C++