summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/test_rational_arithmetic.adb
blob: d33ea393a87f194aecbd2781993835fe45f6a883 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- { dg-do compile }

with Rational_Arithmetic;
use  Rational_Arithmetic;
procedure Test_Rational_Arithmetic is
  R: Rational := 10/2;
  B: Boolean  := R = 5/1;  -- RHS cannot be a Whole
                           -- ("/" has been "undefined")
  C: Boolean  := R = Rational' (5/1);
  D: Boolean  := (6/3) = R;
  E: Boolean  := (2/1 = 4/2);
begin
  R := 1+1/(4/8);
  R := 2*(3/2)-(7/3)*3;
end Test_Rational_Arithmetic;