with P_Util_Biblio; use P_Util_Biblio; with P_Biblio; use P_Biblio; package body P_Rech_Biblio is function RechSeq (Vect: in TV_Biblio; Bib: in TR_Biblio) return Positive is I: Integer := Vect'First; begin -- while I < Vect'Last and then InfStrictNomAnnee (Vect (I), Bib) loop while I < Vect'Last and then Vect (I) < Bib loop I := I + 1; end loop; if Bib = Vect (I) then return I; else return Vect'Last + 1; end if; end RechSeq; function RechDico (Vect: in TV_Biblio; Bib: in TR_Biblio) return Positive is M, Inf, Sup: Integer; begin Inf := 1; Sup := Vect'Last; if Vect (Vect'Last) < Bib then return Vect'Last + 1; else while Inf < Sup loop M := (Inf + Sup) / 2; if not Boolean (Vect (M) < Bib) then Sup := M; else Inf := M + 1; end if; end loop; if Bib = Vect (Sup) then return Sup; else return Vect'Last + 1; end if; end if; end RechDico; end P_Rech_Biblio;