CVS difference for acats/cxg/cxg2005.a

Differences between 1.2 and version 1.3
Log of other versions for file acats/cxg/cxg2005.a

--- acats/cxg/cxg2005.a	1999/03/10 22:19:09	1.2
+++ acats/cxg/cxg2005.a	1999/09/16 20:38:21	1.3
@@ -3,22 +3,22 @@
 --                             Grant of Unlimited Rights
 --
 --     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- d DCA100-97-D-0025, the U.S. Government obtained 
+--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
 --     unlimited rights in the software and documentation contained herein.
---  defined in DFAR 252.227-7013(a)(19).  By making 
---  the Government intends to confer upon all 
---  rights  equal to those held by the Government.  
---  rights to use, duplicate, release or disclose the 
--- ata and computer software in whole or in part, in 
--- ny purpose whatsoever, and to have or permit others 
+--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making
+--     this public release, the Government intends to confer upon all
+--     recipients unlimited rights  equal to those held by the Government.
+--     These rights include rights to use, duplicate, release or disclose the
+--     released technical data and computer software in whole or in part, in
+--     any manner and for any purpose whatsoever, and to have or permit others
 --     to do so.
 --
 --                                    DISCLAIMER
 --
 --     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
---   THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED 
+--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
 --     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- ION OR OTHER INFORMATION RELEASED, MADE AVAILABLE 
+--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
 --     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
 --     PARTICULAR PURPOSE OF SAID MATERIAL.
 --*
@@ -32,7 +32,7 @@
 --      check that a guard digit is used for the operations.
 --      This test uses a generic package to check the addition
 --      and multiplication results.  The
--- instantiated with the standard FLOAT 
+--      generic package is instantiated with the standard FLOAT
 --      type and a floating point type for the maximum number
 --      of digits of precision.
 --
@@ -43,7 +43,8 @@
 --
 -- CHANGE HISTORY:
 --      14 FEB 96   SAIC    Initial Release for 2.1
---
+--      16 SEP 99   RLB     Repaired to avoid printing thousands of (almost)
+--                          identical failure messages.
 --!
 
 -- References:
@@ -72,20 +73,21 @@
    end Guard_Digit_Check;
 
    package body Guard_Digit_Check is
-      -- made global so that the compiler will be more likely 
-      -- to keep the values in memory instead of in higher 
+      -- made global so that the compiler will be more likely
+      -- to keep the values in memory instead of in higher
       -- precision registers.
       X, Y, Z : Real;
       OneX : Real;
       Eps, BN : Real;
 
-      -- special constants - not declared as constants so that 
+      -- special constants - not declared as constants so that
       -- the "stored" precision will be used instead of a "register"
       -- precision.
       Zero : Real := 0.0;
       One  : Real := 1.0;
       Two  : Real := 2.0;
 
+      Failure_Count : Natural := 0;
 
       procedure Thwart_Optimization is
       -- the purpose of this procedure is to reference the
@@ -122,6 +124,8 @@
 		     "  N=" & Integer'Image (N) &
 		     "  difference=" & Real'Image (Z - 2.0*Eps*BN) &
 		     "  Eps*BN=" & Real'Image (Eps*BN) );
+                  Failure_Count := Failure_Count + 1;
+                  exit when Failure_Count > K*4; -- Avoid displaying dozens of messages.
 	       end if;
 	    end loop;
 	 end loop;
@@ -140,14 +144,14 @@
 	  if OneX /= X then
 	     Report.Failed ("multiplication for large values");
 	  end if;
-         
+
 	  X := Real (Real'Machine_Radix) ** (Real'Model_EMin + 1);
 	  OneX := One * X;
 	  Thwart_Optimization;
 	  if OneX /= X then
 	     Report.Failed ("multiplication for small values");
 	  end if;
-       
+
 	  -- selection of "random" values between 1/radix and radix
           Y := One / Real (Real'Machine_Radix);
           Z := Real(Real'Machine_Radix) - One/Real(Real'Machine_Radix);
@@ -157,6 +161,7 @@
 	     Thwart_Optimization;
 	     if OneX /= X then
                 Report.Failed ("multiplication for case" & Integer'Image (I));
+                exit when Failure_Count > 40+8; -- Avoid displaying dozens of messages.
 	     end if;
 	  end loop;
       exception
@@ -189,7 +194,7 @@
    Chk_Float.Do_Test;
 
    if Verbose then
-      Report.Comment ("checking a digits" & 
+      Report.Comment ("checking a digits" &
                       Integer'Image (System.Max_Digits) &
                       " floating point type");
    end if;

Questions? Ask the ACAA Technical Agent