Skip to content

Commit 8572e96

Browse files
authored
Update dsp.h fastmod1f to handle negatives
1 parent 8a24493 commit 8572e96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Utility/dsp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ inline float fastroot(float f, int n)
9999
*/
100100
inline float fastmod1f(float x)
101101
{
102-
return x - static_cast<int>(x);
102+
return x - floorf(x);
103103
}
104104

105105
/** From http://openaudio.blogspot.com/2017/02/faster-log10-and-pow.html

0 commit comments

Comments
 (0)