Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
phoe-krk
on Nov 22, 2022
|
parent
|
context
|
favorite
| on:
Always use [closed, open) intervals
How does [2, 2) make sense?
layer8
on Nov 23, 2022
[–]
It’s the empty interval. It’s the set of numbers
x
for which
x
>= 2 and
x
< 2, which is none, and hence the empty set. It’s the equivalent of this for loop (for integers):
for (int i = 2; i < 2; ++i) { … }
The body of the loop will be executed zero times.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: