Difference between % and mod

For
‘’’
(-3.2) % π
‘’’
I get
‘’’
-0.05840734641020706
‘’’
but for
‘’’
mod(-3.2,π)
‘’’
I get
‘’’
3.083185307179586
‘’’
I like the latter for my purpose but is that difference a bug or a feature?

If you use the help feature ? mod you’ll see that % is an alias for rem(x, y), while mod(x,y) = rem(x,y, RoundDown). So these are slightly different functions.

3 Likes