[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:
parent
6a13e4fc54
commit
1f22ece3d9
|
@ -74,6 +74,9 @@ public:
|
||||||
inline bool PosUtil::
|
inline bool PosUtil::
|
||||||
is_in_interval(float center, float bound, float value)
|
is_in_interval(float center, float bound, float value)
|
||||||
{
|
{
|
||||||
|
if (bound == 0)
|
||||||
|
return value == center ;
|
||||||
|
|
||||||
assert(bound > 0) ;
|
assert(bound > 0) ;
|
||||||
float interval_min = center - bound ;
|
float interval_min = center - bound ;
|
||||||
float interval_max = center + bound ;
|
float interval_max = center + bound ;
|
||||||
|
|
Loading…
Reference in New Issue