Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ru.iate.lab1;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * Created by Bitizen on 26.03.17.
- */
- public class Random {
- private static final int CAPACITY = 300;
- private static final int NUMBERS = 8;
- private static final double Y_0 = 0.32568656;
- private static final int G = 94994426;
- public static void main(String[] args) {
- List<Double> numbers = new ArrayList<>(CAPACITY);
- numbers.add(Y_0);
- for (int i = 1; i < CAPACITY; i++) {
- int pow = NUMBERS / 2;
- double buf = Math.pow(10, pow) * Math.pow(numbers.get(i - 1),2);
- int c = (int) (Math.pow(10, NUMBERS) * (buf - (int) buf));
- numbers.add(i,
- Math.pow(10, -NUMBERS) * c
- );
- }
- for (Double number : numbers) {
- System.out.println(String.valueOf(number));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement