Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
def e(a:(Int, Int)*)=math.sqrt(a map(x=>x._2-x._1)map(x=>x*x)sum)
Requires input as a sequence/vector of var-arg tuples Example:
scala> e((1, 5), (2, 6), (3, 7), (4, 8)) res1: Double = 8.0
def e(a:(Int,Int)*)=math.sqrt(a map(x=>x._2-x._1)map(x=>x*x)sum)
def e(a:Seq[(Int, Int)]*)=math.sqrt(a map(x=>x._2-x._1)map(x=>x*x)sum)
Requires input as a sequence/vector ofsequence/vector of var-arg tuples Example:
scala> e(Seq((1, 5), (2, 6), (3, 7), (4, 8))) res1: Double = 8.0
def e(a:Seq[(Int, Int)])=math.sqrt(a map(x=>x._2-x._1)map(x=>x*x)sum)
Requires input as a sequence/vector of tuples Example: