Changeset 13708


Ignore:
Timestamp:
Oct 9, 2019 8:44:34 AM (2 months ago)
Author:
Jonathan Kämpe
Message:

#5844 Refactoring for clarity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-jk-2471-2/Compiler/ModelicaMiddleEnd/src/jastadd/structural/Symbolic.jrag

    r13636 r13708  
    217217    private static Boolean FEquation.nominalAllowsDivision(FExp factor, FVariable var, double tol) {
    218218        if (factor.variability().constantVariability()) {
    219             FExp nominal = factor.dynamicFExp(var.nominal());
    220             if (nominal.variability().constantVariability() &&
    221                     Math.abs(factor.ceval().realValue()) *
    222                     nominal.ceval().realValue() < tol) {
    223                 return false;
     219            FExp varNominalExp = factor.dynamicFExp(var.nominal());
     220            if (varNominalExp.variability().constantVariability()) {
     221                double factorNominal = Math.abs(factor.ceval().realValue());
     222                double varNominal    = varNominalExp.ceval().realValue();
     223                double totalNominal  = factorNominal * varNominal;
     224                if (totalNominal < tol) {
     225                    return false;
     226                }
    224227            }
    225228        }
Note: See TracChangeset for help on using the changeset viewer.