1-- C4A010A.ADA
2
3--                             Grant of Unlimited Rights
4--
5--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7--     unlimited rights in the software and documentation contained herein.
8--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making
9--     this public release, the Government intends to confer upon all
10--     recipients unlimited rights  equal to those held by the Government.
11--     These rights include rights to use, duplicate, release or disclose the
12--     released technical data and computer software in whole or in part, in
13--     any manner and for any purpose whatsoever, and to have or permit others
14--     to do so.
15--
16--                                    DISCLAIMER
17--
18--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23--     PARTICULAR PURPOSE OF SAID MATERIAL.
24--*
25-- CHECK THAT STATIC UNIVERSAL_REAL EXPRESSIONS ARE EVALUATED EXACTLY.
26
27-- SMALL RATIONAL NUMBERS ARE USED IN THIS TEST.
28
29-- JBG 5/3/85
30
31WITH REPORT; USE REPORT;
32PROCEDURE C4A010A IS
33
34     C13 : CONSTANT := 1.0/3.0;
35     C47 : CONSTANT := 4.0/7.0;
36     C112: CONSTANT := 13.0/12.0;
37     HALF: CONSTANT := 3.5/7.0;
38
39BEGIN
40
41     TEST ("C4A010A", "CHECK STATIC UNIVERSAL_REAL ACCURACY FOR " &
42                      "SMALL RATIONAL NUMBERS");
43
44     IF C13 - C47 /= -5.0/21.0 THEN
45          FAILED ("REAL SUBTRACTION RESULT INCORRECT");
46     END IF;
47
48     IF C47 + C112 = 1.0 + 55.0/84.0 THEN
49          NULL;
50     ELSE
51          FAILED ("REAL ADDITION RESULT INCORRECT");
52     END IF;
53
54     IF C112 - C13 /= 6.0/8.0 THEN
55          FAILED ("LCD NOT FOUND");
56     END IF;
57
58     IF 0.1 * 0.1 /= 0.01 THEN
59          FAILED ("REAL MULTIPLICATION RESULT INCORRECT");
60     END IF;
61
62     IF C112/C13 /= 13.0/4 THEN
63          FAILED ("REAL QUOTIENT RESULT INCORRECT");
64     END IF;
65
66     IF 0.1 ** 4 /= 0.0001 THEN
67          FAILED ("POSITIVE EXPONENTIATION RESULT INCORRECT");
68     END IF;
69
70     IF C13 ** (-3) /= 27.0 * 0.5 * 2 THEN
71          FAILED ("NEGATIVE EXPONENTIATION RESULT INCORRECT");
72     END IF;
73
74     IF HALF /= 0.1/0.2 THEN
75          FAILED ("FRACTIONAL NUMERATOR AND DENOMINATOR");
76     END IF;
77
78     RESULT;
79
80END C4A010A;
81