diff --git a/Eigen/src/Core/SelfCwiseBinaryOp.h b/Eigen/src/Core/SelfCwiseBinaryOp.h index 0caf2bab1..22f3047b4 100644 --- a/Eigen/src/Core/SelfCwiseBinaryOp.h +++ b/Eigen/src/Core/SelfCwiseBinaryOp.h @@ -185,7 +185,10 @@ inline Derived& DenseBase::operator/=(const Scalar& other) internal::scalar_product_op >::type BinOp; typedef typename Derived::PlainObject PlainObject; SelfCwiseBinaryOp tmp(derived()); - tmp = PlainObject::Constant(rows(),cols(), NumTraits::IsInteger ? other : Scalar(1)/other); + Scalar actual_other; + if(NumTraits::IsInteger) actual_other = other; + else actual_other = Scalar(1)/other; + tmp = PlainObject::Constant(rows(),cols(), actual_other); return derived(); }