Skip to content

Commit

Permalink
[CodeFactor] Apply fixes to commit 02c9271
Browse files Browse the repository at this point in the history
  • Loading branch information
code-factor committed Nov 8, 2024
1 parent 4f738e6 commit c854545
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/oscillators/Cti.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ protected override double Calculation()
}

// Check for numerical stability
double denomX = points * sxx - sx * sx;
double denomY = points * syy - sy * sy;
double denomX = (points * sxx) - (sx * sx);
double denomY = (points * syy) - (sy * sy);

if (denomX > 0 && denomY > 0)
{
return (points * sxy - sx * sy) / Math.Sqrt(denomX * denomY);
return ((points * sxy) - (sx * sy)) / Math.Sqrt(denomX * denomY);
}

return 0;
Expand Down

0 comments on commit c854545

Please sign in to comment.