Logo

Programming-Idioms

History of Idiom 202 > diff from v8 to v9

Edit summary for version 9 by Skepter:
New Java implementation by user [Skepter]

Version 8

2019-09-29, 11:27:34

Version 9

2019-10-05, 05:04:54

Idiom #202 Sum of squares

Calculate the sum of squares s of data, an array of floating point values.

Idiom #202 Sum of squares

Calculate the sum of squares s of data, an array of floating point values.

Imports
import java.util.Arrays;
Code
Arrays.stream(data).map(i -> i * i).sum()