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
Post a Comment