Is there any way to find arithmetic mean “better” than sum()/N?

前端 未结 6 1745
情书的邮戳
情书的邮戳 2020-12-23 17:48

Suppose we have N numbers(integers, floats, whatever you want) and want to find their arithmetic mean. Simplest method is to sum all values and divide by number of values:

6条回答
  •  感动是毒
    2020-12-23 18:14

    If the big integers are problem... is it ok

    a/N + b/N+.... n/N
    

    I mean you're looking just for other ways or the optimal way?

提交回复
热议问题