Advertisement
Guest User

Untitled

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