APL/DEV 3.2/TP04/Derecursivation/Recursif.java
2022-10-26 11:13:11 +02:00

13 lines
292 B
Java

public class Recursif {
public static double f(double v) {
if (v == 0) return 0.0;
if (v == 1) return 1.0;
return v + f(Math.floor(v / 2)) - f(Math.floor(v / 3));
}
public static void main(String[] args) {
System.out.println(f(250));
}
}