Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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++) {
- double buf = G * numbers.get(i-1);
- 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