java - Multiplying Bigintegers in parallel mode -


i want write android code multiplies 10,000 numbers in parallel mode. example divide them groups , multiply each group in thread..((async task)) , multiply results of each group. dont know how it, can help?

use parallel stream.

list<biginteger> integers = new arraylist<>(); // fill data biginteger result = integers.parallelstream()     .reduce(biginteger.one, (a, e) -> a.multiply(e)); system.out.println(result); 

Comments

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

html - How to custom Bootstrap grid height? -