エントリーの編集
![loading...](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/common/loading@2x.gif)
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント2件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
![アプリのスクリーンショット](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/entry/app-screenshot.png)
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Streamで2つの集計を同時に行う - きしだのHatena
個数と平均と合計、最大、最小を取るのであれば、標準でできます。 IntSummaryStatistics iss = IntStre... 個数と平均と合計、最大、最小を取るのであれば、標準でできます。 IntSummaryStatistics iss = IntStream.of(2, 5, 7) .summaryStatistics(); System.out.printf("%d %d %.1f%n", iss.getCount(), iss.getSum(), iss.getAverage()); ただ、二乗和とかを取ろうと思うと、自分で畳込み処理をする必要があります。 public static class Statistics{ int squared; int total; int count; } Statisticsvs = IntStream.of(2, 5, 7).collect( () -> new Statistics(), (v, i) -> { v.count++; v.total += i; v
2013/12/19 リンク