fixed typos
This commit is contained in:
parent
a50307c4d4
commit
6426a6ccfb
@ -28,6 +28,10 @@ public class Polynomial {
|
|||||||
this(new int[]{0,1});
|
this(new int[]{0,1});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getDegree() {
|
||||||
|
return degree;
|
||||||
|
}
|
||||||
|
|
||||||
//Option 1 Kopie des Arrays
|
//Option 1 Kopie des Arrays
|
||||||
public int[] getCoeef() {
|
public int[] getCoeef() {
|
||||||
return werte.clone();
|
return werte.clone();
|
||||||
@ -179,7 +183,7 @@ public class Polynomial {
|
|||||||
public int apply(int v) {
|
public int apply(int v) {
|
||||||
int res = werte[werte.length - 1];
|
int res = werte[werte.length - 1];
|
||||||
for (int i = werte.length - 2; i >= 0; i--)
|
for (int i = werte.length - 2; i >= 0; i--)
|
||||||
res = res + v * werte[i];
|
res = res * v + werte[i];
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user