Difference between revisions of "Modulo operation"

From Maths
Jump to: navigation, search
(Saving work, stub page really)
 
m (Alec moved page Modulo opeartion to Modulo operation without leaving a redirect: Typo in title)
 
(No difference)

Latest revision as of 17:48, 7 January 2018

Definition

For aN0 and bN "a modulo b", written usually as a%b in most programming languages or using a mod(a,b) function is the remainder of dividing a by b.

Implementation

I write this page because I have used:

  • a%b=(ab
    Floor
    (ab))
    • Caveat:This only works for non-negative values!
      TODO: Proof?

See also

Extensions

  • What about negative numbers?
  • 2.5 mod 1 is safely and obviously 0.5 - this is quite common.

References