java - What should be the optimal way to find the average of a large number of integers? -
each of integers can large size of integer (java int-32 bits), storing sum of integer numbers in integer variable isn't option. i'm afraid using java bigints might affect performance badly.
right i'm trying divide , conquer while using long store sum.
are there better solutions?
you can use long (64-bit) hold sum. if overrun that, biginteger way go.
Comments
Post a Comment