The Mudcat Café TM
Thread #143073 Message #3301412
Posted By: DMcG
03-Feb-12 - 07:34 AM
Thread Name: 5
Subject: RE: 5
Can you have a negative prime number?
When Ada-80 was being designed, part of a quiz was ask what 'div' (integer division) and 'mod' (remainder of an integer division) sums were for:
7 div 3
-7 div 3
7 div -3
-7 div -3
7 mod 3
-7mod 3
7 mod -3
-7 mod -3
And also to ask which of several identities were true, such as
x = (x div y)*y + (x mod y)
(-x) div (-y) = x div y
and so on. It became quite clear that almost no-one has a good intuitive grasp of div and mod outside strictly positive nmbers.