Java Reference
In-Depth Information
This works well, even coping with some large numbers, as can be seen in the screenshot in
Figure 14.2 .
Figure 14.2. Our Factorizor in action
But if you enter a sizable number (around 18-20 digits), it takes longer to process the an-
swer and the browser will display a warning, as shown in Figure 14.3 .
Figure 14.3. Factorizing an extremely large number
To make matters worse, it's impossible to click on the Change Color button while the
factors are being calculated―the whole program freezes until the operation is complete.
The good news is that we can use web workers to solve this problem. First of all we create
Search WWH ::

Custom Search