Top "Modulo" questions

The modulo (sometimes called modulus) operation finds the remainder of division of one number by another.

How to code a modulo (%) operator in C/C++/Obj-C that handles negative numbers

One of my pet hates of C-derived languages (as a mathematician) is that (-1) % 8 // comes out as -1, and not 7 …

c++ c c++11 operator-overloading modulo
Find if variable is divisible by 2

How do I figure out if a variable is divisible by 2? Furthermore I need do a function if it is …

javascript modulo divide
Modulo operation with negative numbers

In a C program i was trying the below operations(Just to check the behavior ) x = 5 % (-3); y = (-5) % (3); z = (…

c gcc modulo
Can't use modulus on doubles?

I have a program in C++ (compiled using g++). I'm trying to apply two doubles as operands to the modulus …

c++ modulo
How to calculate modulus of large numbers?

How to calculate modulus of 5^55 modulus 221 without much use of calculator? I guess there are some simple principles in number …

math modulo
Assembly Language - How to do Modulo?

Is there something like a modulo operator or instruction in x86 assembly?

assembly x86 modulo integer-division
How does java do modulus calculations with negative numbers?

Am I doing modulus wrong? Because in Java -13 % 64 is supposed to evaluate to -13 but I get 51.

java math modulo negative-number
Mod of negative number is melting my brain

I'm trying to mod an integer to get an array position so that it will loop round. Doing i % arrayLength …

c# math modulo
Calculate modulo in sh script

I am working on an sh script in which I am in a WHILE loop where a variable gets incremented …

sh modulo
'MOD' is not a recognized built-in function name

I wanted to use MOD function in SQL Server 2008R2 and followed this link but still got the message: 'MOD' …

sql sql-server-2008 tsql sql-server-2008-r2 modulo