# Why Kotlin needs downTo instead of just allowing a negative step?

**URL:** <https://discuss.kotlinlang.org/t/why-kotlin-needs-downto-instead-of-just-allowing-a-negative-step/28370>\
**Category:** Language Design\
**Created:** [March 24, 2024, 3:56pm UTC](https://discuss.kotlinlang.org/t/why-kotlin-needs-downto-instead-of-just-allowing-a-negative-step/28370 "2024-03-24T15:56:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kylexie186](https://avatars.discourse-cdn.com/v4/letter/k/91b2a8/32.png) [@kylexie186](https://discuss.kotlinlang.org/u/kylexie186)\
**Post date:** [March 24, 2024, 3:56pm UTC](https://discuss.kotlinlang.org/t/why-kotlin-needs-downto-instead-of-just-allowing-a-negative-step/28370/1 "2024-03-24T15:56:50Z")

</div>

Hey folks, I have a simple question but I can’t figure out for long while since I learned Kotlin…

Why does Kotlin needs a separate `downTo` infix instead of allowing the `step` to accept negative numbers? e.g. What is the counter example that a clause like `10 rangeTo 1 step -1` confuses the compiler?

---

<div class="post-metadata">

**Author:** ![al3c](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@al3c](https://discuss.kotlinlang.org/u/al3c)\
**Post date:** [March 25, 2024, 6:19pm UTC](https://discuss.kotlinlang.org/t/why-kotlin-needs-downto-instead-of-just-allowing-a-negative-step/28370/2 "2024-03-25T18:19:40Z")

</div>

> [@kylexie186](#):
>
> 10 rangeTo 1

`10 rangeTo 1` is an empty range.  
And `step` simply skips elements while trasversing a range, so it doesn’t take negative arguments.

The compiler isn’t confused or anything, those were explicit choices.

The are other ways to define those methods, and one could get away with fewer methods. It’s a choice for better readability imho
