From: Doni Pracner Date: Thu, 6 Feb 2014 15:29:50 +0000 (+0100) Subject: PolinomL dodata KoeficijentUz X-Git-Tag: v14a~8^2~20 X-Git-Url: https://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;h=8ea141bd11f257ecaa188607303730099b5c6a67;p=spa1skripta-public.git PolinomL dodata KoeficijentUz --- diff --git a/kodovi/polinomi/POLINOML.DEF b/kodovi/polinomi/POLINOML.DEF index a88e55b..da9ff34 100644 --- a/kodovi/polinomi/POLINOML.DEF +++ b/kodovi/polinomi/POLINOML.DEF @@ -16,6 +16,7 @@ PROCEDURE Kopiraj(p: Polinom; VAR kopija: Polinom); PROCEDURE PostaviClan(k: REAL; st:CARDINAL; VAR p:Polinom); +PROCEDURE KoeficijentUz(p:Polinom; st:CARDINAL):REAL; PROCEDURE UbaciMonom(mon:Polinom; VAR p: Polinom); PROCEDURE PromeniZnak(VAR p: Polinom); diff --git a/kodovi/polinomi/POLINOML.MOD b/kodovi/polinomi/POLINOML.MOD index 309b349..6de5165 100644 --- a/kodovi/polinomi/POLINOML.MOD +++ b/kodovi/polinomi/POLINOML.MOD @@ -117,6 +117,21 @@ BEGIN END; END PostaviClan; +PROCEDURE KoeficijentUz(p:Polinom; st:CARDINAL):REAL; +VAR + tekuci : Polinom; +BEGIN + tekuci := p; + WHILE (tekuci#NIL) AND (tekuci^.st > st) DO + tekuci := tekuci^.veza; + END; + IF (tekuci # NIL) AND (tekuci^.st = st) THEN + RETURN tekuci^.k; + ELSE + RETURN 0.0; + END; +END KoeficijentUz; + PROCEDURE UbaciMonom(mon:Polinom; VAR p: Polinom); VAR stari, tekuci, kopija: Polinom;