separate( Test_Log_Family ) procedure Test_LogB( N_Intervals, N_Arguments, Base_Flag : in Int_Type ) is Arg, Log_of_Arg : Value_Table; NLog2_Lead, NLog2_Trail : Float_Type; N, N_Loops : Int_Type; N_Left, N_Right, Left, Right, Length : Int_Type; MRE_Base, MRE_Mach, Bad_Arg, Bad_Base, Bad_Val : Float_Type; Outcome : Status; Func_Name : String(1..17); begin case Base_Flag is when 2 => Func_Name := "Log(X,Base=>2.0) "; when 10 => Func_Name := "Log(X,Base=>10.0)"; when others => Func_Name := "Log(X,Base=>Y) "; end case; N_Left := -N_Limit; N_Right := N_Limit; N_Loops := N_Intervals; Length := (N_Right - N_Left +1) / N_Loops; if (Length = 0) then Length := 1; N_Loops := (N_Right - N_Left + 1); end if; Pr_Acc_Test_Title( Func_Name, "2**N * [1/sqrt(2), sqrt(2)]", N_Loops, N_Arguments, -N_Limit, N_Limit); Pr_Acc_Test_Report_Head(Func_Name); for Loop_Cnt in -2..N_Loops loop case Loop_Cnt is when -2 => N := 0; when -1 => N := -1; when 0 => N := 1; when others => Left := N_Left + (Loop_Cnt-1)*Length; if (Loop_Cnt = N_Loops) then Right := N_Right; else Right := Left + Length - 1; end if; N := Rand_Int( Left, Right ); end case; Test_LogB_Interval( N, N_Arguments, Base_Flag, MRE_Base, MRE_Mach, Bad_Arg, Bad_Base, Bad_Val, Outcome ); if (Outcome = OK) then if (Base_Flag /= 2 and Base_Flag /= 10) then Pr_Acc_Test_Report( Func_Name, N, N_Arguments, MRE_Base, MRE_Mach, Bad_Arg, Bad_Base, Bad_Val); else Pr_Acc_Test_Report( Func_Name, N, N_Arguments, MRE_Base, MRE_Mach, Bad_Arg, Bad_Val); end if; else Pr_Exception( Bad_Arg ); if (Base_Flag /= 2 and Base_Flag /= 10) then Pr_Exception( Bad_Base ); end if; end if; end loop; return; end Test_LogB;