[Positioner] PosUtil::is_in_interval(): bound == 0

PosUtil::is_in_interval() now handles a zero interval width. That is
required in case of standard deviation equals to zero.
This commit is contained in:
Matteo Cypriani 2012-06-20 18:36:30 +02:00
parent 6a13e4fc54
commit 1f22ece3d9
1 changed files with 3 additions and 0 deletions

View File

@ -74,6 +74,9 @@ public:
inline bool PosUtil::
is_in_interval(float center, float bound, float value)
{
if (bound == 0)
return value == center ;
assert(bound > 0) ;
float interval_min = center - bound ;
float interval_max = center + bound ;