| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5e30e6c commit 35c30a2
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,11 +27,13 @@ public MathWorker() { | |||
| 27 | 27 | ||
| 28 | 28 | @Override | |
| 29 | 29 | public void run() { | |
| 30 | + BigDecimal bigDecimal = BigDecimal.ZERO; | ||
| 30 | 31 | while (true) { | |
| 31 | - BigDecimal sum = BigDecimal.ZERO; | ||
| 32 | - for (int i = 0; i <= Integer.MAX_VALUE; i++) { | ||
| 33 | - double value = Math.atan(Math.sqrt(Math.pow(random.nextInt(10), random.nextDouble()))); | ||
| 34 | - sum = sum.add(BigDecimal.valueOf(value)); | ||
| 32 | + double value = Math.atan(Math.sqrt(Math.pow(random.nextInt(10), random.nextDouble()))); | ||
| 33 | + if (random.nextInt(10) > 5) { | ||
| 34 | + bigDecimal = bigDecimal.add(BigDecimal.valueOf(value)); | ||
| 35 | + } else { | ||
| 36 | + bigDecimal = bigDecimal.subtract(BigDecimal.valueOf(value)); | ||
| 35 | 37 | } | |
| 36 | 38 | } | |
| 37 | 39 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments