%------------------------------------------------------------------------ % Defines natural and integer division (Number Theory Style) % % There is no universally agreed semantics for integer division for a % negative argument. For a negative argument, division can be defined % with truncation towards or away from zero. The definition in this % theory truncates away from zero (i.e. div(-7,3) = -3). This is is the % approach used in most number theory books. This approach has the % advantage that div(i,m) = the greatest integer less than i/m. The % alternate approach (i.e. truncation towards zero: div(-7,3) = -2) is % simpler to compute because div(-i,m) = -div(i,m) under that % definition. It is the method defined in tha Ada reference manual. % % To prevent confusion with other "div", this one has been renamed "tdiv" % % %% AUTHOR % ------ % % Ricky W. Butler % Mail Stop 130 fax: (804) 864-4234 % NASA Langley Research Center phone: (804) 864-6198 % Hampton, Virginia 23681-0001 %------------------------------------------------------------------------
BEGIN
i,k: VAR int
n: VAR nat
m: VAR posnat
j: VAR nonzero_integer
x: VAR real
negi,ngi2: VAR negint
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.