Integer roots: Difference between revisions
Content deleted Content added
Scala contribution added. |
|||
Line 542: | Line 542: | ||
=={{header|Scala}}== |
=={{header|Scala}}== |
||
===Functional solution, tail recursive, no immutables=== |
|||
<lang Scala>import scala.annotation.tailrec |
<lang Scala>import scala.annotation.tailrec |
||
Line 571: | Line 572: | ||
}</lang> |
}</lang> |
||
{{Out}}See it running in your browser by [https://scalafiddle.io/sf/bVwlHfa/0 ScalaFiddle (JavaScript, non JVM)] or by [https://scastie.scala-lang.org/0T93IhLVRGiYfuKpW7DTUg Scastie (JVM)]. |
{{Out}}See it running in your browser by [https://scalafiddle.io/sf/bVwlHfa/0 ScalaFiddle (JavaScript, non JVM)] or by [https://scastie.scala-lang.org/0T93IhLVRGiYfuKpW7DTUg Scastie (JVM)]. |
||
=={{header|Scheme}}== |
=={{header|Scheme}}== |
||
{{trans|Python}} |
{{trans|Python}} |