How to find cube root in Scala

1 Answer

0 votes
object FindCubeRoot_Scala {
  def main(args: Array[String]): Unit = {
    println(math.cbrt(0))
    println(math.cbrt(27))
    println(math.cbrt(-27))
    println(math.cbrt(16))
  }
}
 
 
 
/*
run:
     
0.0
3.0
-3.0
2.5198420997897464
     
*/

 



answered Sep 2, 2024 by avibootz

Related questions

1 answer 168 views
1 answer 136 views
1 answer 90 views
90 views asked Oct 4, 2024 by avibootz
1 answer 114 views
114 views asked Sep 2, 2024 by avibootz
1 answer 103 views
103 views asked Nov 16, 2022 by avibootz
1 answer 98 views
...