package body defining_program_unit_name is
declarative_part
[begin
handled_sequence_of_statements]
end [[parent_unit_name.]identifier];
begin
--reduces X and Y to the same denominator:
...
end Same_Denominator;
U : Rational := X;
V : Rational := Y;
begin
Same_Denominator (U,V);
return U.Numerator = V.Numerator;
end "=";
begin
if Y > 0 then
return (Numerator => X, Denominator => Y);
else
return (Numerator => -X, Denominator => -Y);
end if;
end "/";
function "-" (X,Y : Rational) return Rational is ... end "-";
function "*" (X,Y : Rational) return Rational is ... end "*";
function "/" (X,Y : Rational) return Rational is ... end "/";