home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / std / c / 2583 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.5 KB

  1. Path: sparky!uunet!mcsun!uknet!acorn!ixi!clive
  2. From: clive@x.co.uk (Clive Feather)
  3. Newsgroups: comp.std.c
  4. Subject: Re: space optimization involving enum
  5. Message-ID: <1992Sep07.103132.19727@x.co.uk>
  6. Date: 7 Sep 92 10:31:32 GMT
  7. References: <1992Aug25.160905.9177@sq.sq.com> <1992Aug26.222505.7496@sneaky.lonestar.org> <1992Aug29.232155.14657@sq.sq.com>
  8. Organization: IXI Limited, Cambridge, UK
  9. Lines: 20
  10.  
  11. In article <1992Aug29.232155.14657@sq.sq.com> msb@sq.sq.com (Mark Brader) writes:
  12. >>> ... The representation of [decimal] 10000 has to use the bit
  13. >>> sequence 10011100010000.  
  14. >> As I read it, wrong.  Nothing I see prevents use of 2's complement, 
  15. >> 1's complement, or excess-2**(n-1) (the sign bit being reversed from
  16. >> 2's complement).
  17. > These systems are indeed all permissible.  But they also all use the
  18. > bit sequence 10011100010000 in the representation of decimal 10000.
  19.  
  20. Both wrong. Excess-2**(n-1) is not a permitted system, because the
  21. representation of decimal 10000 is not binary 10011100010000. The
  22. standard requires that the representation of integers be a "pure-binary"
  23. system, except for the sign bit, and that unsigned and signed integers
  24. use the same representation for numbers where their ranges overlap.
  25.  
  26. -- 
  27. Clive D.W. Feather     | IXI Limited         | If you lie to the compiler,
  28. clive@x.co.uk          | 62-74 Burleigh St.  | it will get its revenge.
  29. Phone: +44 223 462 131 | Cambridge   CB1 1OJ |   - Henry Spencer
  30. Fax:   +44 223 462 132 | United Kingdom      |
  31.