By default, approx considers numbers within a relative tolerance of 1e-6 (i.e. one part in a million) of its expected value to be equal. This treatment would lead to surprising results if the expected value was 0.0, because nothing but 0.0 itself is relatively close to 0.0. To handle this case less surprisingly, approx also considers numbers within an absolute tolerance of 1e-12 of its expected value to be equal.
它并没有说默认值在小数点后三位以内,而是说它在
1e-6
-或0.000001
之内^ {}参数可以用来改变所考虑的大致相同的值:
相关问题 更多 >
编程相关推荐