Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on Is page range inclusive or exclusive?

Parent

Is page range inclusive or exclusive?

+2
−0

When writing a bibliography entry, if I want to cite pages 1 up to 10, including both 1 and 10 (i.e., 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10) should I write 1-10 or 1-11?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

This post was sourced from https://writers.stackexchange.com/q/47951. It is licensed under CC BY-SA 4.0.

0 comment threads

Post
+0
−0

I may be wrong, but when I saw this I immediately thought of Python's range, where the number used is the stop number - i.e., stop before you get to that number. That also fits well with the way loops are typically structured in many other computer languages. So from a programming standpoint, this makes perfect sense.

However, unless (and arguably, even if) your readers are computer programmers, the expectation will be that pages x - y means all pages with numbers >= x and <= y. In addition to examples provided by others, the obvious example to me of why it must be that way is the last page of the book. If a book has 100 pages numbered 1 - 100, and you are referencing information on the last 2 pages, the reference will be 99-100. Referencing 99-101 would clearly not make sense since 101 does not exist. Using Python notation, the reference would be range(99,101) but it is a lot simpler to say 99-100.

In fact, a program to extract or otherwise process the pages might be something like extract_pages(x, y) and internally reference range(x, y+1), so that the user of the function would pass the actual first & last page numbers.

There are good reasons why range and similar programming constructs use a stop (termination condition) value rather than a last value, but those are computer science discussions and not really relevant here.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

1 comment thread

General comments (3 comments)
General comments
Canina‭ wrote over 4 years ago

If we're going down that route, might as well point out that C-derived languages typically (if not always) use a loop termination condition, which may or may not have anything to do with a loop counter variable. For example, for(int i=0; getch() != EOF; i++) {} will terminate not when i reaches any particular value, but when a end-of-file is encountered on the input, while i will indicate the number of characters read. for(;;) {} is an endless loop as it lacks a termination condition.

Canina‭ wrote over 4 years ago · edited over 4 years ago

Even in a more traditional for(int i=0; i<N; i++) {} for some value N, unless interrupted (e.g. by break;), the loop will run for N iterations with i counting from 0 through N-1 inclusive; but nothing about the language actually dictates this construct, and it is equally valid (though non-idiomatic) to write for(int i=1; i<=N; i++) {} for the same number of loop iterations, but with i counting from 1 through N inclusive.

manassehkatz‭ wrote over 4 years ago

All true about C-style for loops. I was trying to limit the answer a bit, including (I think) just enough to get the point across. "computer science discussions..."