PR target/84336
[official-gcc.git] / gcc / testsuite / gnat.dg / rational_arithmetic.ads
blobf4398c5143cfca01154b66f23e95c4404dfd6f41
1 package Rational_Arithmetic is
2 -- Whole numbers
3 type Whole is new Integer;
4 --
5 -- Undefine unwanted operations
6 function "/" (Left, Right: Whole) return Whole is abstract;
7 --
8 -- Rational numbers
9 --
10 type Rational is private;
12 -- Constructors
14 function "/" (Left, Right: Whole) return Rational;
16 -- Rational operations
18 function "-" (Left, Right: Rational) return Rational;
20 -- Mixed operations
22 function "+" (Left: Whole ; Right: Rational) return Rational;
23 function "-" (Left: Whole ; Right: Rational) return Rational;
24 function "-" (Left: Rational; Right: Whole ) return Rational;
25 function "/" (Left: Whole ; Right: Rational) return Rational;
26 function "*" (Left: Whole ; Right: Rational) return Rational;
27 function "*" (Left: Rational; Right: Whole ) return Rational;
29 -- Relational
31 function "=" (Left: Rational; Right: Whole) return Boolean;
33 private
34 type Rational is record
35 Numerator, Denominator: Whole;
36 end record;
37 end Rational_Arithmetic;