Re: Integer Promotion?



Eric Sosman posted:


sizeof(int) >= sizeof(short)


Many C++ books explain it like that. (But more on this below...)


From several of your recent posts, I get the impression that
you are now in that phase of fascination with representations
that besets many beginning programmers (and from which some few
never seem to recover).


I thinks it's because I want as firm an understanding as I can grasp of
the core features and functionality of the language.

Plus I just find it downright interesting.

While I can program proficiently at the moment, I feel a little
incompetent when the conversation switches to things like integer
promotion, and bitwise operations on signed integers.

I want to understand these things.


C programmers seem (after years of entirely non-scientific
observation) to be somewhat more likely than users of other
languages to persist in this infantile preoccupation. They are
always fretting about an integer's bits, about a pointer's bits,
about the arrangement of bit-field struct elements, about padding
bytes, about endianness, and so on and so on.


Which is exactly the reason why I'm on this newsgroup.

I program in C++ -- but if you've ever taken a look at comp.lang.c++, all
the conversation is to do with vectors, multiple inheritence, virtual
base class templates...

I want to talk about the core functionality of the language, and this is
the best place to do it, and it has the greatest minds when it comes to
it too. If I ask about integer promotion on this newsgroup rather than on
a C++ one, I'll get about 500% more responses.


C programmers don't seem unusually obsessed with the bits
in floating-point representations; they are usually content to let
the number just be itself, which I consider a healthy attitude.


I actually wanted to learn about floating-point representations at one
stage... but it only took one minute of reading through some very
technical documentation to put me off. I guess I just don't have the
"mathematical" kind of brain. Sure, I'm good at maths, but I rather drink
bleach than spend my day on permutations and other multi-syllabic words
of that nature... ; )

People who do a PhD in maths have a unique kind of brain; the kind of
brain that doesn't want to vomit when it comes to topics like
differentiation, integration, etc..


--

Frederick Gotham
.



Relevant Pages

  • Re: Perceptual symbol systems
    ... > brain" during a surgery in his brain. ... that is an example of storage. ... the result of novel manipulations of representations. ... "storage" and manipulation of information in the ...
    (sci.cognitive)
  • Re: Is there "an unconscious"?
    ... >The way we process all the information is incredibly complex. ... >examples themselves are of simplifying the representations. ... >different way more suitable to our brain). ... >you recommend them based on your misunderstanding of my words. ...
    (sci.psychology.psychotherapy.moderated)
  • Re: Perceptual symbol systems
    ... > brain" during a surgery in his brain. ... He reports several sensations, ... the result of novel manipulations of representations. ... one's internal manipulation of information, ...
    (sci.cognitive)
  • Re: SCWC 32: Discussion: IMPLEMENT
    ... You _really_ need to learn something about language. ... how /does/ it parse something like "the cat sat ... I am as aware as anybody of the limitations of common sense. ... auditory representations of words ...
    (rec.puzzles.crosswords)
  • Re: This calculation is just wrong / computer cant count!
    ... rounding is good, in which case you have to accept 0.83333333333333337 as a valid value! ... longer sensible to keep this discussion up when you keep inisisting that representations ... this is "basic maths" and it is based on the rounding of the ... When approximations are used, errors can be introduced. ...
    (microsoft.public.vc.mfc)