fixed roundoff error issue