fredoverflow
fredoverflow

Reputation: 263220

Why does C have these weird translation limits (section 2.2.4.1)?

I was just browsing the C standard the other day, and the chapter about translation limits really had me stumped. Why are some translation limits 2^n, others 2^n+1 and others 2^n-k (for some small k)?

Here are just some examples:

Why isn't everything simply a power of two?

Upvotes: 4

Views: 196

Answers (1)

JeremyP
JeremyP

Reputation: 86661

Why isn't everything simply a power of two?

To me, most of them look like 2n - 1, even the line length, once you add carriage return and line feed.

These are minimum limits, by the way. Compilers are allowed to exceed them.

Upvotes: 1

Related Questions