ntp+hwclock: add margin to estimated delay quantiles

Extend the interval of accepted delays by half of the quantile minimum
step in both directions to make room for floating-point errors in the
quantile calculation and an error that will be intentionally added in
the next commit.
This commit is contained in:
Miroslav Lichvar
2024-11-18 16:18:40 +01:00
parent 77962bb527
commit c92358e041
2 changed files with 5 additions and 3 deletions

View File

@@ -1742,7 +1742,7 @@ check_delay_quant(NCR_Instance inst, double delay)
quant = QNT_GetQuantile(inst->delay_quant, QNT_GetMinK(inst->delay_quant));
if (delay <= quant)
if (delay <= quant + QNT_GetMinStep(inst->delay_quant) / 2.0)
return 1;
DEBUG_LOG("maxdelayquant: delay=%e quant=%e", delay, quant);