[CodeFactor] Apply fixes to commit 0606491

This commit is contained in:
codefactor-io
2026-03-12 19:37:50 +00:00
parent 060649192f
commit 8f79257155
384 changed files with 1197 additions and 1215 deletions
+1 -1
View File
@@ -383,7 +383,7 @@ public class HammaTests
double weightSum = 0;
for (int i = 0; i < period; i++)
{
weights[i] = 0.54 - 0.46 * Math.Cos(twoPiOverPm1 * i);
weights[i] = 0.54 - (0.46 * Math.Cos(twoPiOverPm1 * i));
weightSum += weights[i];
}
@@ -163,7 +163,7 @@ public sealed class HammaValidationTests : IDisposable
double weightSum = 0;
for (int i = 0; i < period; i++)
{
weights[i] = 0.54 - 0.46 * Math.Cos(twoPiOverPm1 * i);
weights[i] = 0.54 - (0.46 * Math.Cos(twoPiOverPm1 * i));
weightSum += weights[i];
}
@@ -187,11 +187,11 @@ public sealed class HammaValidationTests : IDisposable
int period = 5;
double twoPiOverPm1 = 2.0 * Math.PI / (period - 1);
double w0 = 0.54 - 0.46 * Math.Cos(0); // 0.08
double w1 = 0.54 - 0.46 * Math.Cos(twoPiOverPm1 * 1); // ≈0.54
double w2 = 0.54 - 0.46 * Math.Cos(twoPiOverPm1 * 2); // 1.0
double w3 = 0.54 - 0.46 * Math.Cos(twoPiOverPm1 * 3); // ≈0.54
double w4 = 0.54 - 0.46 * Math.Cos(twoPiOverPm1 * 4); // 0.08
double w0 = 0.54 - (0.46 * Math.Cos(0)); // 0.08
double w1 = 0.54 - (0.46 * Math.Cos(twoPiOverPm1 * 1)); // ≈0.54
double w2 = 0.54 - (0.46 * Math.Cos(twoPiOverPm1 * 2)); // 1.0
double w3 = 0.54 - (0.46 * Math.Cos(twoPiOverPm1 * 3)); // ≈0.54
double w4 = 0.54 - (0.46 * Math.Cos(twoPiOverPm1 * 4)); // 0.08
Assert.Equal(0.08, w0, 1e-10);
Assert.Equal(0.08, w4, 1e-10);