Article View: comp.std.c
Article #3017Re: Is INT_MAX<<1 defined?
From: Dik T. Winter
Date: Sun, 13 Dec 1992 00:29
Date: Sun, 13 Dec 1992 00:29
23 lines
1717 bytes
1717 bytes
Norman Diamond discusses with volpe@ausable.crd.ge.com about mathematical
bits, implementation bits, operations on values and operations on
representations.
What it comes down to is that << is not a mathematical operation, there
is nothing in mathematics that tells us that 16384 << 1 equals 32768.
So what is the meaning of:
1. Operation on value in this case? Where in the standard does it tell
us that for signed (16 bit) int 16384, 16384 << 1 is 32768? Is an
implementation not allowed to define it as -32768? Or whatever?
But in all there is no definition in *mathematics* for this operation.
2. Mathematical bits? What's that? Where in mathematics are bits
defined (except in coding theory, where they are used in a completely
different context where shifts are unheard of)?
The bottom-line is that shifting is not a mathematical concept, shifting
is a "computer science" concept. So it makes no sense to talk about
mathematical operation on values or about mathematical bits. When you
have shifted something the concept of a *value* is lost (except perhaps
in a computer science sense, which is not my field) and you need other
means to determine whether or not trapping is allowed.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland
home: bovenover 215, 1025 jn amsterdam, nederland; e-mail: dik@cwi.nl
Technical Details
Message-ID:
<8322@charon.cwi.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!cwi.nl!dikReferences:
<1992Dec1.050540 <1992Dec8.1 <Bz35no.J6M@jrd.dec.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!cwi.nl!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.std.c Subject: Re: Is INT_MAX<<1 defined? Message-ID: <8322@charon.cwi.nl> Date: 13 Dec 92 00:29:50 GMT References: <1992Dec1.050540 <1992Dec8.1 <Bz35no.J6M@jrd.dec.com> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 23