Skip to content

Commit bddcef9

Browse files
committed
Euclidean norm in scala
1 parent a145259 commit bddcef9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def euclideanNorm(p: List[Double]): Double =
2+
math.sqrt(p.map(n => n*n).sum)

0 commit comments

Comments
 (0)