Skip to content

Commit

Permalink
- fix undefined behaviour
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11967 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Jun 1, 2012
1 parent 6b60460 commit 55104a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/solver/initialization.c
Expand Up @@ -145,7 +145,7 @@ double leastSquareWithLambda(DATA* data, INIT_DATA* initData, double lambda)
else
scalingCoefficient = 1.0; /* no scaling coefficients given */

if(initData->residualScalingCoefficients[i] > 0.0)
if(scalingCoefficient > 0.0)
funcValue += (initData->initialResiduals[i] / scalingCoefficient) * (initData->initialResiduals[i] / scalingCoefficient);
/*else
funcValue += initData->initialResiduals[i] * initData->initialResiduals[i];*/
Expand Down

0 comments on commit 55104a4

Please sign in to comment.