-- --
-- S p e c --
-- --
--- --
--- Copyright (C) 1994,1995,1996 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
with Interfaces;
package System.Arith_64 is
-pragma Pure (Arith_64);
+ pragma Pure;
subtype Int64 is Interfaces.Integer_64;
function Multiply_With_Ovflo_Check (X, Y : Int64) return Int64;
-- Raises Constraint_Error if product of operands overflows 64
- -- bits, otherwise returns the 64-bit signed integer difference.
+ -- bits, otherwise returns the 64-bit signed integer product.
procedure Scaled_Divide
(X, Y, Z : Int64;
Q, R : out Int64;
Round : Boolean);
-- Performs the division X / (Y * Z), storing the quotient in Q and
- -- the remainder in R. Constraint_Error is raised if Y or Z is zero.
- -- Round indicates if the result should be rounded. If Round is False,
- -- then Q, R are the normal quotient and remainder from a truncating
- -- division. If Round is True, then Q is the rounded quotient. The
- -- remainder R is not affected by the setting of the Round flag. The
- -- result is known to be in range except for the noted possibility of
- -- Y or Z being zero, so no other overflow checks are required.
+ -- the remainder in R. Constraint_Error is raised if Y or Z is zero,
+ -- or if the quotient does not fit in 64-bits. Round indicates if the
+ -- result should be rounded. If Round is False, then Q, R are the normal
+ -- quotient and remainder from a truncating division. If Round is True,
+ -- then Q is the rounded quotient. The remainder R is not affected by the
+ -- setting of the Round flag.
end System.Arith_64;