Parameters: integrate the cyclic-wrap function
a much more complete and robust implementation, but requires a precision limit to be pre-computed in the floating-point case