home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / std / c / 3202 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  1.6 KB

  1. Path: sparky!uunet!mcsun!sun4nl!cwi.nl!dik
  2. From: dik@cwi.nl (Dik T. Winter)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Is INT_MAX<<1 defined?
  5. Message-ID: <8322@charon.cwi.nl>
  6. Date: 13 Dec 92 00:29:50 GMT
  7. References: <1992Dec1.050540 <1992Dec8.1 <Bz35no.J6M@jrd.dec.com>
  8. Sender: news@cwi.nl
  9. Organization: CWI, Amsterdam
  10. Lines: 23
  11.  
  12. Norman Diamond discusses with volpe@ausable.crd.ge.com about mathematical
  13. bits, implementation bits, operations on values and operations on
  14. representations.
  15.  
  16. What it comes down to is that << is not a mathematical operation, there
  17. is nothing in mathematics that tells us that 16384 << 1 equals 32768.
  18. So what is the meaning of:
  19. 1.  Operation on value in this case?  Where in the standard does it tell
  20.     us that for signed (16 bit) int 16384, 16384 << 1 is 32768?  Is an
  21.     implementation not allowed to define it as -32768?  Or whatever?
  22.     But in all there is no definition in *mathematics* for this operation.
  23. 2.  Mathematical bits?  What's that?  Where in mathematics are bits
  24.     defined (except in coding theory, where they are used in a completely
  25.     different context where shifts are unheard of)?
  26. The bottom-line is that shifting is not a mathematical concept, shifting
  27. is a "computer science" concept.  So it makes no sense to talk about
  28. mathematical operation on values or about mathematical bits.  When you
  29. have shifted something the concept of a *value* is lost (except perhaps
  30. in a computer science sense, which is not my field) and you need other
  31. means to determine whether or not trapping is allowed.
  32. -- 
  33. dik t. winter, cwi, kruislaan 413, 1098 sj  amsterdam, nederland
  34. home: bovenover 215, 1025 jn  amsterdam, nederland; e-mail: dik@cwi.nl
  35.