误差检测逻辑

error detecting logic