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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -