ichrysou / u-kernel-rtos

0 stars 0 forks source link

Modulo in c #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 9 years ago
In c the % operator is the division remainder. To get the actual modulo 
(mathematically speaking) you need:

#define MODULO(n, m) (((n % m) + m) % m)

Then the MODULO(n, m) implementation in c is the same as the % operator in 
PYTHON.

Original issue reported on code.google.com by ichry...@gmail.com on 26 Aug 2014 at 11:55