# \[Math\] Intervals: examples of open intervals; fencepost errors

DevFeed: [\[Math\] Intervals: examples of open intervals; fencepost errors](<https://devfeed.tech/articles/math-intervals-examples-of-open-intervals-fencepost-errors-20567.md>)

Original publisher: [Read original article](<https://yurichev.com/blog/intervals_open_fence/>)

Published: 2025-12-18T23:00:00Z

Content type: article

Language: en

Sources: [Dennis Yurichev](<https://devfeed.tech/sources/dennis-yurichev.md>)

Topics: [math](<https://devfeed.tech/topics/math.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [errors](<https://devfeed.tech/tags/errors.md>), [examples](<https://devfeed.tech/tags/examples.md>), [math](<https://devfeed.tech/tags/math.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

This article explains open, closed, and half-open intervals in programming, using divisor ranges and loop boundaries to illustrate how confusion between interval types causes fencepost errors. It also notes Dijkstra's advocacy of half-open intervals and zero-based arrays.

## Source excerpt

[Math] Intervals: examples of open intervals; fencepost errors