Path: utzoo!attcan!uunet!mcsun!ukc!dcl-cs!gdt!exspes From: exspes@bath.ac.uk (P E Smee) Newsgroups: comp.lang.c Subject: Re: Shouldn't ANSI have provided nonvolatile instead of volatile? Message-ID: <1990Feb13.114041.4178@bath.ac.uk> Date: 13 Feb 90 11:40:41 GMT References: <1117.18:37:35@stealth.acf.nyu.edu> <1990Feb8.162440.22318@utzoo.uucp> <17910@rpp386.cactus.org> <1990Feb12.182343.14269@utzoo.uucp> Organization: University of Bristol c/o University of Bath Lines: 29 In article <1990Feb12.182343.14269@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In article <17910@rpp386.cactus.org> woody@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@bristol.ac.uk :-) (..!uunet!ukc!gdr.bath.ac.uk!exspes if you MUST)