the result of fmod(-0.6, 0.01) is -0.01 is this an error?
no it is not. check out this statement (see your math.h, assuming you are using the RealView compiler): "fmod returns the value x - i * y, for some integer i such that, if y is nonzero, the result has the same sign as x and magnitude less than the magnitude of y. If y is zero, a domain error occurs and -HUGE_VAL is returned."