A
Alan Connor
Why do you talk to an obviously knowledgable man as if he was a member of
an inferior species who had never seen a computer before?
an inferior species who had never seen a computer before?
Alan said:Why do you talk to an obviously knowledgable man as if he was a member of
an inferior species who had never seen a computer before?
It is far from obvious that Roose is knowledgeable, at least in areas of
knowledge that this newsgroup recognises as relevant.
FWIW, IUWJM
Apparently, it was "That is what I thought as well."
But when I looked at it, I figured
RH: "You recall incorrectly."
JP: "Then I will [something] take a walk."
maniac said:Hey guys, I'm new here, just a simple question.
I'm learning to Program in C, and I was recommended a book called,
"Mastering C Pointers", just asking if any of you have read it,
and if it's worth the $25USD.
I'm just looking for a book on Pointers, because from what I've
read it's one of the toughest topics to understand.
thanks in advanced.
sincerely ... Andy
Wouldn't left shift be better? Or are today's compilers "smart" enough
to do this kind of stuff themselves? /*Someone had mentioned this
possibility earlier (particular case was multiplication by 2).*/
I have no idea what that means. Is it a breakfast food?
See my post elsethread for why that's a bad definition.
"Mornington Crescent" is a joke on "I'm Sorry I Haven't A Clue", a Radio 4
'comedy' quiz program. The contestants (always the same four, I think, so
really they're members of the cast - Tim Brooke-Taylor and Graeme Garden of
"The Goodies",
one of Barry {Humphries|Cryer},
Cryer
and some other bloke)
there are in fact no rules whatsoever.
I understand I may have broken some kind of cabalistic law by revealing this
fact, so if I don't post any more after today, you'll know why.
The Standard says: "Such a pointer, called a null pointer, is guaranteed to
compare unequal to a pointer to any object or function."
The Standard disagrees with you.
FWIW, IUWJM
Mark McIntyre said:I must have either completely missed that post, or misunderstood it.
Could you paraphrase?
Surely you mean "cranking /in/ the data"?
Data is (or are!) what you put into a computer. What it cranks out is
information.
Well, that's the general idea, anyway.
For the curious, the "compensation" code for a negative dividend
(and positive divisor) -- remember in x / y, x is the dividend and
y is the divisor -- works out to the following, all assuming 2s
complement and an arithmetic right-shift:
/* divide signed input "x" by divisor, whose log2 is d2 */
int divide_by_power_of_two(int x, int divisor, int d2) {
int adj;
/* required: (1 << d2) == divisor */
adj = (x & SIGNBIT) ? divisor - 1 : 0;
return (ux + adj) >> d2;
}
For the curious, the "compensation" code for a negative dividend ... [with "int x, adj, divisor", and assuming two's complement]
adj = (x & SIGNBIT) ? divisor - 1 : 0;
... I was read the output of GCC for [various] functions [and found]
y/=2 in the second if conditional is turned into the following x86
code by GCC 3.3.1:
movl %edx, %eax ; temp = y
shrl $31, %eax ; temp >>= 31
leal (%eax,%edx), %eax ; temp = temp + y
sarl %eax ; temp >>= 1;
movl %eax, %edx ; y = temp
Mark said:I disagree that it disagrees. In order to compare p to NULL, you must
convert p to a pointer type (see quote above, plus 6.3.2.3-4). I'm
doubtful that you could convert a null pointer constant to a pointer
type without storing it somewhere....
Mark said:Ah, so whats the difference between the stuff that comes out of a 1401
and goes into a 7094? Does it magically get transmogrified during the
technician's walk down the hall with the tape?*
Hmmmm. I find this distinction highly artificial.
Chris Torek said:On a typical RISC we get something like:
mov x, reg # assuming x is already in a register
asr reg, 31, reg # where asr is arithmetic shift right
and reg, 3, reg # for divisor == 4
add reg, x, reg
asr reg, 2, reg # again for divisor == 4
# final result is now in "reg"
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.