use TTInt instead of int64_t in the rounding process, to avoid overflow. And add a test case