diff --git a/packages/belos/src/BelosStatusTestGenResNorm.hpp b/packages/belos/src/BelosStatusTestGenResNorm.hpp index 4b9d11e664c5..d5c7860dc5d2 100644 --- a/packages/belos/src/BelosStatusTestGenResNorm.hpp +++ b/packages/belos/src/BelosStatusTestGenResNorm.hpp @@ -541,12 +541,8 @@ StatusType StatusTestGenResNorm::checkStatus( Iteration::compute () // Teuchos::ScalarTraits when its template parameter is not a // floating-point type. (Ifpack2 sometimes gets instantiated for // integer Scalar types.) - const IST oneOverMinDiagVal = (MinDiagonalValue_ == zero) ? - KAT::one () / static_cast (SmallTraits::eps ()) : - KAT::one () / static_cast (MinDiagonalValue_); + IST oneOverMinDiagVal = KAT::one () / static_cast (SmallTraits::eps ()); + if ( MinDiagonalValue_ != zero) + oneOverMinDiagVal = KAT::one () / static_cast (MinDiagonalValue_); + // It's helpful not to have to recompute this magnitude each time. const magnitude_type minDiagValMag = STS::magnitude (MinDiagonalValue_);