Skip to content

Commit

Permalink
MSVC does not inline rint
Browse files Browse the repository at this point in the history
This change gives 2x improvement
  • Loading branch information
crsib committed Sep 28, 2023
1 parent c65d41d commit b476643
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/lib-time-and-pitch/StaffPad/TimeAndPitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ namespace {
// wrap a phase value into -PI..PI
inline float _unwrapPhase(float arg)
{
return arg - std::rint(arg * 0.15915494309f) * 6.283185307f;
return arg - int(arg * 0.15915494309f + 0.5f) * 6.283185307f;
}

void _unwrapPhaseVec(float* v, int n)
Expand Down

0 comments on commit b476643

Please sign in to comment.