Re: Integers and standard
- From: "James Giles" <jamesgiles@xxxxxxxxxxxxxxxx>
- Date: Tue, 29 Jul 2008 23:24:47 GMT
glen herrmannsfeldt wrote:
James Giles wrote:
(snip)
The standard isn't about what machines exist. It's only about
what the language means independent of what machine it's
on. The standard can't (or, at least, doesn't) assume that no
such machines have, can, or will exist.
Yes, the standard doesn't specify which machines exist,
nor the lengths of different data types. But users of the
standard have to decide on the length to specify.
Those lengths are based on machines that really exist.
There are three participants, not two. The standard (and its
committee), the implementor, and the user. The standard
can't (or won't - which amounts to the same thing) specify
how bit patterns with the sign bit set correlate to a value
when those bits are interpreted as numbers. The implementor
can (and usually does) specify such things. The user can't
assume such things unless he needs not have portable code.
Your previous articles seemed to me to indicate false contradictions
to the first and third of those observations. Sure, implementations
exist in which two's complement is used for 32-bit integers.
Sure, implementatons may not (as yet) exist which are both
32-bit and other then two's complement. Neither the committee
nor the user may *assume* that such haven't, don't, or won't exist.
And most users don't explicitly choose a length. The usually
choose default integers - whatever length that is. They only
go beyond that when the range turns out insufficient (or too
bulky - if they're going the other way).
--
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
"Simplicity is prerequisite for reliability" -- E. W. Dijkstra
.
- Follow-Ups:
- Re: Integers and standard
- From: glen herrmannsfeldt
- Re: Integers and standard
- From: dpb
- Re: Integers and standard
- References:
- Integers and standard
- From: Alfredo Buttari
- Re: Integers and standard
- From: James Van Buskirk
- Re: Integers and standard
- From: Steven G. Kargl
- Re: Integers and standard
- From: Dan Nagle
- Re: Integers and standard
- From: James Giles
- Re: Integers and standard
- From: glen herrmannsfeldt
- Re: Integers and standard
- From: James Giles
- Re: Integers and standard
- From: glen herrmannsfeldt
- Integers and standard
- Prev by Date: Re: Simple Program, Lots of Issues (F90)
- Next by Date: Re: Integers and standard
- Previous by thread: Re: Integers and standard
- Next by thread: Re: Integers and standard
- Index(es):