1-- C4A010B.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
26-- EXACTLY.  IN PARTICULAR, CHECK THAT THE CASCADING USE OF FRACTIONAL
27-- VALUES DOES NOT RESULT IN THE LOSS OF PRECISION.
28
29-- RJW 7/31/86
30
31WITH REPORT; USE REPORT;
32PROCEDURE C4A010B IS
33
34
35BEGIN
36
37     TEST( "C4A010B", "CHECK THAT STATIC UNIVERSAL REAL EXPRESSIONS " &
38                      "ARE EVALUATED EXACTLY.  IN PARTICULAR, CHECK " &
39                      "THAT THE CASCADING USE OF FRACTIONAL VALUES " &
40                      "DOES NOT RESULT IN THE LOSS OF PRECISION" );
41
42     DECLARE
43          B : CONSTANT := 2.0/3.0;
44
45          X0 : CONSTANT := 1.0;
46          X1 : CONSTANT := X0 + B;
47          X2 : CONSTANT := X1 + B ** 2;
48          X3 : CONSTANT := X2 + B ** 3;
49          X4 : CONSTANT := X3 + B ** 4;
50          X5 : CONSTANT := X4 + B ** 5;
51          X6 : CONSTANT := X5 + B ** 6;
52          X7 : CONSTANT := X6 + B ** 7;
53          X8 : CONSTANT := X7 + B ** 8;
54          X9 : CONSTANT := X8 + B ** 9;
55
56          Y1 : CONSTANT := B ** 10;
57          Y2 : CONSTANT := 1.0;
58          Y3 : CONSTANT := Y1 - Y2;
59          Y4 : CONSTANT := B;
60          Y5 : CONSTANT := Y4 - Y2;
61          Y6 : CONSTANT := Y3 / Y5;
62
63     BEGIN
64          IF X9 /= 58025.0/19683.0 THEN
65               FAILED ( "INCORRECT RESULTS FOR SERIES OF NAMED " &
66                        "NUMBERS  - 1" );
67          END IF;
68
69          IF Y6 /= 58025.0/19683.0 THEN
70               FAILED ( "INCORRECT RESULTS FOR SERIES OF NAMED " &
71                        "NUMBERS  - 2" );
72          END IF;
73
74          IF X9 /= Y6 THEN
75               FAILED ( "INCORRECT RESULTS FOR SERIES OF NAMED " &
76                        "NUMBERS  - 3" );
77          END IF;
78
79     END;
80
81     RESULT;
82END C4A010B;
83