Modulo operation
We can calculate the modulo or remainder using the NumPy mod()
, remainder()
, and fmod()
functions. Also, we can use the %
operator. The main difference among these functions is how they deal with negative numbers. The odd one out in this group is the fmod()
function.
Get NumPy : Beginner's Guide - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.