我需要指定两个数字在小数点后第三位是相同的: 1.2345和1.2348是正确的。但是1.2345和1.2388是不正确的。我需要让用户指定有多少地方应该程序检查。
我在想这样的事情:
do {
x = f(i++);// will count some number with i iterations
x_next = f(i++);// will count some number with i+1 iterations
} while (fabs(x - x_next) > accuracy);// there should be some difference, ca