Talk:Modular arithmetic

From Rosetta Code
Revision as of 21:22, 11 March 2013 by rosettacode>Soegaard (Created page with "The task description ends with: <pre> It is important that the function f is agnostic about whether or not its argument is modular. It should behave the same way with...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The task description ends with:

    It is important that the function f is agnostic about whether or not its argument is modular. 
    It should behave the same way with normal and modular integers. 
    In other words, the function is an algebraic expression that could be used with any ring, not just integers.

For languages that represent elements in, says, Z/5Z as the integers 0,1,2,3,4 there is no way to distinguish an element of Z/5Z from n element in Z. This is slightly annoying since the remainder of the task is interesting in its own right.