xapian-core  1.4.25
Functions
roundestimate.h File Reference

Round a bounded estimate to an appropriate number of S.F. More...

#include <algorithm>
#include <cmath>
#include "exp10.h"
+ Include dependency graph for roundestimate.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
Xapian::doccount round_estimate (T lb, T ub, T est)
 Round a bounded estimate to an appropriate number of S.F. More...
 

Detailed Description

Round a bounded estimate to an appropriate number of S.F.

Definition in file roundestimate.h.

Function Documentation

◆ round_estimate()

template<typename T >
Xapian::doccount round_estimate ( lb,
ub,
est 
)
inline

Round a bounded estimate to an appropriate number of S.F.

The algorithm used looks at the lower and upper bound and where the estimate sits between them and picks a number of significant figures which doesn't suggest much more precision than there is, while still providing a useful estimate.

Definition at line 37 of file roundestimate.h.

References est(), and exp10().

Referenced by Xapian::MSet::get_matches_estimated().