Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PF {
- static double x1, x2;
- public static void main(String... args){
- int n=10;
- Random rand = new Random();
- x1 = rand.nextDouble();
- double x2 = rand.nextDouble();
- ArrayList<Double> wynikig5 = new ArrayList<>();
- ArrayList<Double> wynikig6 = new ArrayList<>();
- for(int i=0;i<n;i++){
- double t = x1 + x2;
- x1 = x2;
- wynikig5.add(generatorG5(t));
- wynikig6.add(generatorG6(t));
- }
- }
- static double generatorG5(double t) {
- double wynik = 0;
- if (t >= 4) wynik += 4;
- x2 = t;
- wynik = 0.25 * t;
- return wynik;
- }
- static double generatorG6(double t) {
- double wynik = 0;
- x1 = x2;
- x2 = t - Math.floor(t);
- wynik = x2;
- return wynik;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement