Skip to content

Commit

Permalink
Merge pull request #782 from KitsunebiGames/purefix
Browse files Browse the repository at this point in the history
Fix purity of wave generators
  • Loading branch information
p0nce committed Jul 28, 2023
2 parents a79d0ec + 54c4a0b commit 6b2fc13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/dplug/core/math.d
Original file line number Diff line number Diff line change
Expand Up @@ -251,19 +251,19 @@ unittest
}

/// Quick and dirty sawtooth for testing purposes.
T rawSawtooth(T)(T x) pure nothrow @nogc
T rawSawtooth(T)(T x) nothrow @nogc
{
return normalizePhase(x) / (cast(T)PI);
}

/// Quick and dirty triangle for testing purposes.
T rawTriangle(T)(T x) pure nothrow @nogc
T rawTriangle(T)(T x) nothrow @nogc
{
return 1 - normalizePhase(x) / cast(T)PI_2;
}

/// Quick and dirty square for testing purposes.
T rawSquare(T)(T x) pure nothrow @nogc
T rawSquare(T)(T x) nothrow @nogc
{
return normalizePhase(x) > 0 ? 1 : -1;
}
Expand Down

0 comments on commit 6b2fc13

Please sign in to comment.