--* -- -- OBJECTIVE: -- Check that if Float'Machine_Radix is a power of 10, Float'Digits is equal -- to Float'Model_Mantissa. (Defect Report 8652/0004). -- -- CHANGE HISTORY: -- 18 JAN 2001 PHL Initial version -- --! with Report; use Report; procedure C35802B is Machine_Radix : Integer := Float'Machine_Radix; Is_Power_Of_Ten : Boolean; begin Test ("C35802B", "CHECK THAT IF FLOAT'MACHINE_RADIX IS 10 " & "OR A POWER OF 10, " & "THEN FLOAT'DIGITS = FLOAT'MODEL_MANTISSA"); -- Determine if Machine_Radix is a power of 10. Is_Power_Of_Ten := True; while Machine_Radix > 10 loop if Machine_Radix mod 10 /= 0 then Is_Power_Of_Ten := False; exit; end if; Machine_Radix := Machine_Radix / 10; end loop; if Is_Power_Of_Ten then Is_Power_Of_Ten := Machine_Radix = 10; end if; if Is_Power_Of_Ten then if Float'Digits /= Float'Model_Mantissa then Failed ("FLOAT'DIGITS NOT EQUAL TO FLOAT'MODEL_MANTISSA - STATIC"); elsif Ident_Int (Float'Digits) /= Ident_Int (Float'Model_Mantissa) then Failed ("FLOAT'DIGITS NOT EQUAL TO FLOAT'MODEL_MANTISSA - NON-STATIC"); end if; else Not_Applicable ("FLOAT'MACHINE_RADIX IS NOT A POWER OF 10"); end if; Result; end C35802B;