What is the meaning of “exclusive” and “inclusive” when describing number ranges?

In computer science, inclusive/exclusive doesn’t apply to algorithms, but to a number range (more specifically, to the endpoint of the range):

1 through 10 (inclusive)
1 2 3 4 5 6 7 8 9 10

1 through 10 (exclusive)
1 2 3 4 5 6 7 8 9

In mathematics, the two ranges above would be:

[1, 10]
[1, 10)

You can remember it easily:

  • Inclusive – Including the last number
  • Exclusive – Excluding the last number

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)