Skip to content

Commit

Permalink
Fix log calculation in componentdialog.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed Jan 8, 2025
1 parent 25df9f1 commit 7a662b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qucs/components/componentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,13 +597,13 @@ void ComponentDialog::updateSweepProperty(const QString& property)
if (property == "Start" || property == "Stop" || property == "Points" || property == "All")
{
double points = str2num(pointsEdit->value());
double step = (points - 1.0) / log10(fabs((stop < 1.0 ? 1.0 : stop) / (start < 1.0 ? 1.0 : start)));
double step = (points - 1.0) / log10(fabs((stop) / (start)));
sweepParamWidget["Step"]->setValue(misc::num2str(step));
}
else if (property == "Step")
{
double step = str2num(sweepParamWidget["Step"]->value());
double points = log10(fabs((stop < 1.0 ? 1.0 : stop) / (start < 1.0 ? 1.0 : start))) * step + 1.0;
double points = log10(fabs((stop) / (start))) * step + 1.0;
pointsEdit->setValue(QString::number(round(points), 'g', 16));
}
}
Expand Down

0 comments on commit 7a662b7

Please sign in to comment.