Tell me more ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How do you calculate the modulus of a fractional number, a negative number or a positive number?

Could you explain any example with the whole process?

share|improve this question
2  
Can you clarify a little? I'm not sure what you are referring to. Do you mean mathematics such as $7 + 5 \equiv 2 \pmod{10}$? – Niel de Beaudrap Feb 26 '12 at 14:05
1  
Is your question about magnitude of complex numbers, or does it refer to modular arithmetic (in which case "modulus of a number" has no meaning; instead use "number modulo m"). – Gone Feb 26 '12 at 16:41

1 Answer

One way to extend the remainder, or modulo, function $b\mod a$ to a fractional number $b$ is to subtract from $b$ the greatest integer $a\times q$ that is less than or equal to $b$, where $q$ must be an integer.

The operation defined above could be written as $b - a\times \lfloor b/a \rfloor$, where $\lfloor x\rfloor$ represents the greatest integer less than or equal to $x$.

Example. If $b = 5/2$ and $a = 2$, then by the above definition, $b\mod a = 5/2 - 2 \cdot \lfloor (5/2)/2\rfloor = 5/2 - 2 \cdot \lfloor 5/4\rfloor = 5/2 - 2 = 1/2$.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.