Create Max points

Should be careful with double calculation. First, convert int to double before calculation, Second, be careful with 0.0 and -0.0, + 0.0 can solve this problem.