Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
n = norm2( data )
func Euclidean(data []float64) float64 {
n := 0.0
for _, val := range data {
n += val * val
}
return math.Sqrt(n)
const n = Math.hypot(...data)
var n = Math.hypot.apply(null, data)
double n = 0d;
for(double value : data) {
n += value * value;
}
n = Math.sqrt(n);
data := #( 5 4 3 2 1 ).
n := data squared sum sqrt.