<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
-2147483648 div 2147483647 ?<br>-2147483648 mod 2147483647 ?<br><br>quotient = -1, remainer = -1 seems reasonable.<br>2147483647 * -1 + -1 == -2147483648<br><br><br>However, Modula-3 specifies div as rounding down, so<br><br>-2147483648 div 2147483647 == -2<br><br>and then<br><br>http://www.modula3.com/cm3/doc/reference/arithmetic.html<br><br>The value <tt>x DIV y</tt> is the floor of
the quotient of <tt>x</tt> and <tt>y</tt>; that is, the maximum integer
not exceeding the real number <tt>z</tt> such that <tt>z * y = x</tt>.
For integers <tt>x</tt> and <tt>y</tt>, the value of <tt>x MOD y</tt> is
defined to be <tt>x - y * (x DIV y)</tt>.
This means that for positive <tt>y</tt>, the value of <tt>x MOD y</tt>
lies in the interval <tt>[0 .. y-1]</tt>, regardless of
the sign of <tt>x</tt>. For negative <tt>y</tt>, the value of
<tt>x MOD y</tt> lies in the interval <tt>[y+1 .. 0]</tt>, regardless
of the sign of <tt>x</tt>.
<BR><br>-2147483648 - 2147483647 * -2<br>
-2147483648 +2 (due to overflow)<br>
-2147483646<br><br>which contradicts the second part.<br><br>Maybe I'm confused? I should work this all through again?<br><br> - Jay<br> </body>
</html>