mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
non-specialized progressions, including "step" progressions. DefaultProgressionHandler uses the "first/last/step" properties of the progression when building the loop header.
14 lines
210 B
Kotlin
Vendored
14 lines
210 B
Kotlin
Vendored
fun Int.digitsUpto(end: Int): Int {
|
|
var sum = 0
|
|
for (i in rangeTo(end)) {
|
|
sum = sum*10 + i
|
|
}
|
|
return sum
|
|
}
|
|
|
|
// 0 iterator
|
|
// 0 getStart
|
|
// 0 getEnd
|
|
// 0 getFirst
|
|
// 0 getLast
|
|
// 0 getStep |