Hallo,
wieso kann ich nicht das Ergebnis zurück geben?
wieso kann ich nicht das Ergebnis zurück geben?
Java:
public class MyClass{
private static final double TOLERANZ = 0.00000001;
static double ergebnis;
static Boolean bo;
static int t = 1;
public static double macheEtwas(double n) {
ergebnis = 0.0;
bo = true;
while(true) {
ergebnis = Math.pow(-1, t + 1) * (Math.pow(n, t) / t);
if(Math.abs((Math.pow(n, t) / t)) < TOLERANZ) {
bo = false;
}
t = t + 1;
}
return ergebnis; // Hier ist das Problem ich kann das nicht zurückgeben.
}
}