From 8ea141bd11f257ecaa188607303730099b5c6a67 Mon Sep 17 00:00:00 2001 From: Doni Pracner Date: Thu, 6 Feb 2014 16:29:50 +0100 Subject: [PATCH] PolinomL dodata KoeficijentUz --- kodovi/polinomi/POLINOML.DEF | 1 + kodovi/polinomi/POLINOML.MOD | 15 +++++++++++++++ 2 files changed, 16 insertions(+) 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; -- 2.25.1