3 ms·
>Coding modulus from scratch with just + - / * is a fun little challenge in its own right, but it'll probably take you longer than 10 minutes to write it correc
by imtringued 10y ago
>Coding modulus from scratch with just + - / * is a fun little challenge in its own right, but it'll probably take you longer than 10 minutes to write it correctly and solve fizzbuzz with it.
It's surprisingly easy actually.
var remainder = x - Math.floor(x/y)*y
(Math.floor because javascript)