Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. package ru.iate.lab1;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. /**
  7. * Created by Bitizen on 26.03.17.
  8. */
  9. public class Random {
  10. private static final int CAPACITY = 300;
  11. private static final int NUMBERS = 8;
  12. private static final double Y_0 = 0.32568656;
  13. private static final int G = 94994426;
  14.  
  15. public static void main(String[] args) {
  16. List<Double> numbers = new ArrayList<>(CAPACITY);
  17. numbers.add(Y_0);
  18. for (int i = 1; i < CAPACITY; i++) {
  19. int pow = NUMBERS / 2;
  20. double buf = Math.pow(10, pow) * Math.pow(numbers.get(i - 1),2);
  21. int c = (int) (Math.pow(10, NUMBERS) * (buf - (int) buf));
  22. numbers.add(i,
  23. Math.pow(10, -NUMBERS) * c
  24. );
  25. }
  26. for (Double number : numbers) {
  27. System.out.println(String.valueOf(number));
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement