You can pattern match all described cases like this:
def func(a: Int, b: Int, c: Double) = (a, b, c) match {
case (a, b, 0) => b - a
case (a, b, c) if c > 9 || a == b => 0
case _ => 1 // add your logic here
}
You can pattern match all described cases like this:
def func(a: Int, b: Int, c: Double) = (a, b, c) match {
case (a, b, 0) => b - a
case (a, b, c) if c > 9 || a == b => 0
case _ => 1 // add your logic here
}