Shouldn't ANSI have provided nonvolatile instead of volatile?

P E Smee exspes at bath.ac.uk
Tue Feb 13 22:40:41 AEST 1990


In article <1990Feb12.182343.14269 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>In article <17910 at rpp386.cactus.org> woody at rpp386.cactus.org (Woodrow Baker) writes:
>>FIXED  i.e. fixed point math.  This type would deal with chars,ints, longs
>>and quads.  There would be an assumed binary point in the middle of the
>>data...
>
>But *I* want the assumed binary point three bits from the right! :-)  This
>whole area is a massive swamp of conversion rules, overflow handling, etc.

PL/1 offered that.  In years of PL/1 programming, I believe I only ever
saw two or three programs (by anyone) that used it.  A declaration such
as 'fixed bin (31, 6)' meant you wanted a fixed-point number 31 bits
long, with the assumed binary point 6 bits from the right (or was it
the left?).  It had the advantage over C that you didn't have the
long/int/short/char porting problems -- you said how many BITS you
needed for the value, and let the compiler worry about how many of what
sort of storage units that implied.  (The compiler could pad for
alignment -- unless you forbade it.)

It had the disadvantage that the conversions (particularly when
operating on operands of different types) were so baroque that it was
actually usually easier to simply declare everything as 'fixed bin
(n,0)' (effectively, int/long/short) and to keep track of any assumed
binary point yourself.  Was a rich source of difficulty in the few
places I saw it used.

-- 
Paul Smee, Univ of Bristol Comp Centre, Bristol BS8 1TW, Tel +44 272 303132
 Smee at bristol.ac.uk  :-)  (..!uunet!ukc!gdr.bath.ac.uk!exspes if you MUST)



More information about the Comp.lang.c mailing list