mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #352:properly cast constants
This commit is contained in:
@@ -157,13 +157,13 @@ protected:
|
||||
template<typename Scalar,int AmbiantDim>
|
||||
inline Scalar AlignedBox<Scalar,AmbiantDim>::squaredExteriorDistance(const VectorType& p) const
|
||||
{
|
||||
Scalar dist2 = 0.;
|
||||
Scalar dist2(0);
|
||||
Scalar aux;
|
||||
for (int k=0; k<dim(); ++k)
|
||||
{
|
||||
if ((aux = (p[k]-m_min[k]))<0.)
|
||||
if ((aux = (p[k]-m_min[k]))<Scalar(0))
|
||||
dist2 += aux*aux;
|
||||
else if ( (aux = (m_max[k]-p[k]))<0. )
|
||||
else if ( (aux = (m_max[k]-p[k]))<Scalar(0))
|
||||
dist2 += aux*aux;
|
||||
}
|
||||
return dist2;
|
||||
|
||||
Reference in New Issue
Block a user