fixed bug and numerical instability in circ.mean

- wrong cycle for x=int+1 yielded 0 instead of int; rounding error for
x=366 if int=365 yielded 366 instead of 365