Re: Integer Promotion?
- From: Frederick Gotham <fgothamNO@xxxxxxxx>
- Date: Wed, 28 Jun 2006 13:23:58 GMT
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
.
- Follow-Ups:
- Re: Integer Promotion?
- From: Andrew Poelstra
- Re: Integer Promotion?
- References:
- Integer Promotion?
- From: Frederick Gotham
- Re: Integer Promotion?
- From: Ben Pfaff
- Re: Integer Promotion?
- From: Frederick Gotham
- Re: Integer Promotion?
- From: Eric Sosman
- Re: Integer Promotion?
- From: Frederick Gotham
- Re: Integer Promotion?
- From: Eric Sosman
- Integer Promotion?
- Prev by Date: Re: qsort() results: implementation dependent?
- Next by Date: Re: Working with negative numbers
- Previous by thread: Re: Integer Promotion?
- Next by thread: Re: Integer Promotion?
- Index(es):
Relevant Pages
|