Skip to content

Commit abfa0d4

Browse files
committed
fix: imports to clarify
1 parent aa5f8d8 commit abfa0d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/topics/functions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ When a function is marked with the `tailrec` modifier and meets the required for
423423
the recursion, leaving behind a fast and efficient loop based version instead:
424424

425425
```kotlin
426+
import kotlin.math.cos
427+
import kotlin.math.abs
428+
426429
val eps = 1E-10 // "good enough", could be 10^-15
427430

428431
tailrec fun findFixPoint(x: Double = 1.0): Double =
@@ -434,6 +437,9 @@ starting at `1.0` until the result no longer changes, yielding a result of `0.73
434437
`eps` precision. The resulting code is equivalent to this more traditional style:
435438

436439
```kotlin
440+
import kotlin.math.cos
441+
import kotlin.math.abs
442+
437443
val eps = 1E-10 // "good enough", could be 10^-15
438444

439445
private fun findFixPoint(): Double {

0 commit comments

Comments
 (0)