--- ais/ai-00203.txt 2000/04/14 01:45:08 1.8 +++ ais/ai-00203.txt 2000/07/15 02:30:02 1.9 @@ -8,14 +8,14 @@ !priority Medium !difficulty Hard !qualifier Error -!subject S'Digits when T'Machine_Radix is 10. +!subject S'Digits when T'Machine_Radix is 10 !summary The relationship between S'Digits and T'Model_Mantissa given in 3.5.8(2) states that S'Digits is the largest value of d for which - ceiling(d * log(10)/log(T'Machine_Radix)) + 1 <= T'Model_Mantissa + ceiling(d * log(10) / log(T'Machine_Radix)) + 1 <= T'Model_Mantissa This allows for a "guard digit" which is necessary to take care of extreme circumstances that arise if the Machine_Radix is not @@ -24,7 +24,7 @@ However, this guard digit is unnecessary if Machine_Radix is 10 or a power of 10 and in such a case the relationship should read - ceiling(d * log(10)/log(T'Machine_Radix)) <= T'Model_Mantissa + ceiling(d * log(10) / log(T'Machine_Radix)) <= T'Model_Mantissa If Machine_Radix is 10 this becomes simply @@ -53,11 +53,11 @@ In Ada 83, the user specified a number D of decimal digits and the implementation then provided model numbers using B binary digits. -Intuitively one might expect to need log 10/log 2 (3.3219...) binary +Intuitively one might expect to need log 10 / log 2 (3.3219...) binary digits for every decimal digit (with appropriate rounding up). The -1980 edition of the ARM (3.5.7 third paragraph) says +1980 edition of the Ada Reference Manual (3.5.7 third paragraph) says - (B is the next integer above D*ln(10)/ln(2)). + (B is the next integer above D*ln(10) / ln(2)). So 1 decimal digit might be expected to be equivalent to 4 binary digits, 2 decimal digits equivalent to 7 binary digits and so on. @@ -79,7 +79,7 @@ This surprising behaviour resulted in the addition of one to the formula so that 3.5.7(6) of Ada 83 concludes - (The number B is the integer next above (D*log(10)/log(2)) + 1.) + (The number B is the integer next above (D*log(10) / log(2)) + 1.) In Ada 95 this formula has been generalized to use T'Machine_Radix rather than 2. However, the special case where Machine_Radix is 10

Questions? Ask the ACAA Technical Agent