Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ modulo positive

inline int positive_modulo(int i, int n) {
    return (i % n + n) % n;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #modulo #positive
ADD COMMENT
Topic
Name
3+7 =