diff options
author | Igor Krivenko <anonymous@invalid.net> | 2011-12-09 23:38:41 +0100 |
---|---|---|
committer | Igor Krivenko <anonymous@invalid.net> | 2011-12-09 23:38:41 +0100 |
commit | 36457178f9d12481e699d07c0ac8d25a7e6a854f (patch) | |
tree | e9b12b3ed7e4102fcf1d0c4384fec3c1d4c94f37 /Eigen/src/Eigen2Support/Geometry/AlignedBox.h | |
parent | d400a6245ec0d86b0e3dd2af30e49349ae28b0f0 (diff) |
bug #352:properly cast constants
Diffstat (limited to 'Eigen/src/Eigen2Support/Geometry/AlignedBox.h')
-rw-r--r-- | Eigen/src/Eigen2Support/Geometry/AlignedBox.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Eigen/src/Eigen2Support/Geometry/AlignedBox.h b/Eigen/src/Eigen2Support/Geometry/AlignedBox.h index 2116f9c83..e4e555715 100644 --- a/Eigen/src/Eigen2Support/Geometry/AlignedBox.h +++ b/Eigen/src/Eigen2Support/Geometry/AlignedBox.h @@ -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; |