Thursday, July 1, 2010

modulus implementation

according to "Concrete Mathematics: A Foundation for Computer Science", by Graham, Knuth (yes, that Knuth) and Patashnik 2nd ed. (page 82)(http://www.perlmonks.org/?node_id=87384), the modulus 0 operation returns the left operand intact, by definition:

x mod 0 = x

However, this definition is not applied in all programming languages...