Skip to content

Commit

Permalink
Improve sign check
Browse files Browse the repository at this point in the history
Fixes #825
  • Loading branch information
sanjayankur31 committed Jun 6, 2018
1 parent 5a841f0 commit 883a0a3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions models/vogels_sprekeler_connection.h
Expand Up @@ -298,8 +298,7 @@ VogelsSprekelerConnection< targetidentifierT >::set_status(
updateValue< double >( d, names::Kplus, Kplus_ );

// check if weight_ and Wmax_ has the same sign
if ( not( ( ( weight_ >= 0 ) - ( weight_ < 0 ) )
== ( ( Wmax_ >= 0 ) - ( Wmax_ < 0 ) ) ) )
if ( weight_ != 0 && not( ( weight_ > 0 ) == ( Wmax_ > 0 ) ) )
{
throw BadProperty( "Weight and Wmax must have same sign." );
}
Expand Down

0 comments on commit 883a0a3

Please sign in to comment.