IntStream.html#reduce doc should not mention average

XMLWordPrintable

    • b26
    • Not verified

      A DESCRIPTION OF THE PROBLEM :
      This API https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/util/stream/IntStream.html#reduce(int,java.util.function.IntBinaryOperator) requires that the IntBinaryOperator is an associative accumulation function, as the documentation mentions.

      Down below, the documentation mentions "Sum, min, max, and average [...]", then goes on to exemplify how to compute a sum.

      Mentioning "average" also may imply to some readers that it can be computed using reduce(), however this is not the case as average is not an associative operation.


            Assignee:
            Julia Boes (Inactive)
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: