Skip to content

Commit

Permalink
Corrections from PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwdev01 committed Dec 1, 2024
1 parent e480b74 commit 91ea2e0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/advanced_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,12 @@ double AdvancedDialog::DetermineGuideSpeed()
double AdvancedDialog::PercentChange(double oldVal, double newVal)
{
double chg;
if (oldVal > 0)
if (fabs(oldVal) < 0.0001)
{
chg = fabs(1.0 - newVal / oldVal);
return 100. * newVal; // not meaningful, but avoids divide by zero
}
else
chg = fabs(newVal);
return 100.0 * chg;
return 100. * fabs(1. - newVal / oldVal);
}

// Reacts to param changes in the AD that change the image scale. Calibration step-size is recalculated, calibration is
Expand Down

0 comments on commit 91ea2e0

Please sign in to comment.