LoginSignup
0
2

More than 3 years have passed since last update.

[Swift5]Doubleの配列から平均値を取得する

Last updated at Posted at 2020-06-25
    func getAvarage(from array: [Double]) -> Double {
        let molecule = array.reduce(0, +)
        let denominator = Double(array.count)
        return molecule / denominator
    }
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2