Modulo operation

From Maths
Revision as of 17:48, 7 January 2018 by Alec (Talk | contribs) (Alec moved page Modulo opeartion to Modulo operation without leaving a redirect: Typo in title)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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=(abFloor(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