size and range of int in c

S

spinoza1111

In the light of that last sentence I think it's time, for the fourth
time of asking, to ask "is English your native language".

I'll thank you to stop asking this question. It is stupid, and MOST
offensive to the many non-native ESL students who are more intelligent
and better at English than you.
Before you return to preaching about the meaning of "clarity" to the
rest of us, I wonder if you could explain the paragraph above.

You seem to be suggesting that any machine with finite length integers
is "bad",  Is that it?

No. But it does require the programmer to be at least aware of
numerical analysis in a way that an architecture with virtual memory
and variable-length integers would not. As it happens, -2^64..2^64-1
is more than enough, but as it happens, intelligent programmers (of
whose number very few are left) use a misnamed "Hungarian" (which was
not invented by Charles Szymonyi) to make numerical precision an
internal property and not an accident of a variable, since it's
important to know the limits up front.
 
D

Dik T. Winter

>
> Yes. A tremendous amount of time has been wasted in useless
> "competition" that would have been better spent meeting real human
> needs such as clean water and education.

Right. So what company should tell us how clean water and education is
provided? We now know that according to you Intel and Microsoft should
mandate how everything is done.
 
N

Nick

spinoza1111 said:
I'll thank you to stop asking this question. It is stupid, and MOST
offensive to the many non-native ESL students who are more intelligent
and better at English than you.

When they appear and tell me it's offensive I'll change my ways. I'm
asking you a question. My written English is frequently slipshod, I
agree. But I recognise it, apologise and move on - not bury it in
obfuscation.

Claiming things are offensive to others is a common way to avoid the
debate. Oh, and you're using it - now there's something.

All I'm doing is desperately hunting for an explanation for you using
the language in a way unlike anyone I have ever met or read.

But you didn't. Surprise!
No. But it does require the programmer to be at least aware of
numerical analysis in a way that an architecture with virtual memory
and variable-length integers would not. As it happens, -2^64..2^64-1
is more than enough,
YAWGAICM5P

but as it happens, intelligent programmers (of
whose number very few are left)

and they are dead.
use a misnamed "Hungarian" (which was
not invented by Charles Szymonyi) to make numerical precision an
internal property and not an accident of a variable, since it's
important to know the limits up front.

So using a variable name convention affects the numerical precision of
the compiler does it? Or if not, when the compiler changes you must
change your variable names? You surely can't mean that. So let's
return to my question. As you are not writing comprehensible English,
what's the reason?

I've also asked you to snip sigs innumerable times (well, not strictly
innumerable, but enough for my internal precision to overflow. As you
don't answer questions, and can't follow simple conventions, I'm afraid
it's "plonk" time. I don't have the patience - or time - of some of the
regulars I'm afraid.
 
I

Ian Collins

spinoza1111 said:
Yes, which is just as bad as old Visual Basic. In VB 3.0 you had to
code around "integers" restricted to this range and strings whose
length was similarly restricted.

It isn't a restriction, it is a minimum.
So C is a usable language for safe programming how?

That constitutes a flaw in C. "C integer" does not, in fact, have a
definite meaning, whereas "integer" has a definition in a modern and
safe language such as C Sharp.

The joys of a single platform language.
 
K

Keith Thompson

Richard Heathfield said:
Cray T90s have 48-bit integers. On that platform, if you're using
two's complement like what you call a normal person, the range might
well be -281474976710656 to 281474976710655 (and even if you're not,
it can still be -281474976710655 to 281474976710655).

I happen to know that on the Cray T90 I used, sizeof(int)==8 and
CHAR_BIT==8; in fact, short, int, long, and long long were all 64
bits.

There may well have been padding bits, though; I didn't think to check
that before the system was decommissioned.
 
D

Dik T. Winter

>
> I happen to know that on the Cray T90 I used, sizeof(int)==8 and
> CHAR_BIT==8; in fact, short, int, long, and long long were all 64
> bits.
>
> There may well have been padding bits, though; I didn't think to check
> that before the system was decommissioned.

Not really padding bits, but when you got out of the range of 48 bits
some operations would not work as expected (multiplication).
 
K

Keith Thompson

Dik T. Winter said:
Not really padding bits, but when you got out of the range of 48 bits
some operations would not work as expected (multiplication).

I think those would really be padding bits, then. If INT_MIN and
INT_MAX are, say, -2**47 and +2**47-1, and int occupies 64 bits,
then there are 16 padding bits. Certain values of those padding
bits can create trap representations. (A trap representation
needn't cause a "trap"; the fact that the behavior is undefined
covers multiplication not working as expected.)

I vaguely recall that, on some Cray systems, int and long were the
same size, but long used more of the bits (at the cost of slower code
for some operations).
 
D

Dik T. Winter

> I vaguely recall that, on some Cray systems, int and long were the
> same size, but long used more of the bits (at the cost of slower code
> for some operations).

int used 48 bits and long used all 64 but especially the multiplication was
slow (and probably also division).
 
R

Richard Tobin

So they should have instantly obsoleted the Gould computers?

An unfortunate example. The non-existence of Gould computers would
have saved us years of wasted porting effort and user frustration.
Not because of the C standard though.

-- Richard
 
C

Charlton Wilbur

RH> I can answer that, using what passes for his reasoning:

RH> 1) all clear statements are true 2) therefore all unclear
RH> statements are false 3) everything he says is unclear 4)
RH> therefore everything he says is false

Well, that's *quite* clear, then, isn't it?

Charlton
 
S

spinoza1111

...
 > He needs to know constructively (as in Mathematical intuitionism) what
 > really happens and may be trusted like a normal person to generalize
 > his experience UNLESS he is socialised to do things by rote &
 > shibboleth.

Interesting that you again bring in something you know nothing about.  In
this case intuitionism.  Try once to read the works by Brouwer and

Well, I first encountered it in Evert W Beth and Stefan Korner. Your
foolish attack here is probably Nordic-nationalistic in the irritating
way of the Nordic male who like Heidegger prefers the bruder
schweigen, and like Adorno's attacker on a tram in 1920, hates young
whippersnappers who use High German, he being Lower than whale
scheissen himself.

Some sort of creepy lower middle class Dutch nationalism seems to be
afoot, since you seem offended that Brouwer's ideas are actually
understood in a different language.

From THE OXFORD HANDBOOK OF PHILOSOPHY OF MATHEMATICS AND LOGIC
(Shapiro, OUP 2005):

"...traditional *intuitionists*, such as L. E. J. Brouwer and Arend
Heyting held that mathematics has a subject matter [as opposed to
formalists]: mathematical objects, such as numbers, do exist. However,
Brouwer and Heyting insisted that these objects are mind-dependent.
Natural numbers and real numbers are mental constructions or are the
result of mental constructions. In mathematics, to exist is to be
constructed. Thus, Brouwer and Heyting are anti-realists in ontology,
denying the *objective* existence of mathematical objects. Some of
their writing seems to imply that each person constructs his own
mathematical realm. Communication between mathematicians consists in
exchanging notes about their own constructive activities. This would
make mathematics subjective. It is more common, however, for these
intuitionists, especially Brouwer, to hold that mathematics concerns
the *forms* of mental construction as such. This follows a Kantian
theme, reviving the thesis that mathematics is synthetic apriori."

"This perspective has consequences concerning the proper practice of
mathematics. Most notably, the intuitionist demurs from the law of the
excluded middle-(Av~A)-and other inferences based on it. According to
Brouwer and Heyting, these methodological principles are symptomatic
of faith in the transcendental existence of mathematical objects or
the transcendental truth of mathematical statements. For the
intuitionist, every mathematical assertion must correspond to a
construction."

This is an excellent definition of intuitionism, and there's a clear,
if to my knowledge undrawn, relationship between this and Dijkstra's
mode of thinking. In intuitionism, the only "reality" is mathematical
communication. In Dijkstra's view of programming, a program considered
as a text is a communication of an intent.

The rejection of the excluded middle is echoed in Dijkstra's belief
that testing can NEVER prove bug absence.

The deepest connection is with Kant (have you read Kant, dear Dik?)
Kant believed that noumenal reality (reality in itself) is unknowable
but can be approached as a limit through phenomena. Mathematics is a
form of intution in Kant in which "the medium is the message":
Euclid's theorems are at one and the same time forced upon us by the
way we see the world, and an ultimate reality: likewise, what makes
intuitionism different from formalism is that while the latter makes
mathematical realities into mere constructed games, intuitionism like
Kant says the the forms of perception HAVE NO ALTERNATIVE FORMS and
thus they are the ultimate reality. Other beings might "see" a world
with a different mathematical structure but this is less than an
unknowable noumenon, it's an only possible noumenon.

In Kant, we not only see space,

I SEE SPACE AND IT LOOKS LIKE NOTHING AND I WANT IT AROUND ME - Jenny
Holzer

we see objects arranged in it that never violate the laws of geometry
as we know it. Alternative beings perhaps dwelling amongst us but in a
different dimension (think Twilight Zone, dear Dik) might see
something other than "space", and/or the objects in their z-space
might arrange themselves according to a z-geometry, but we can only
speak of this, we cannot "visualize" it.

Which means that what the intuitionist discovers in proof by
construction are not assertions about the tools used, they are
"synthetic apriori" (informative but proved logically) assertions
about the way the world is, because in intuitionism, the world cannot
be considered apart from the way we apprehend it.

Which is probably why elegance mattered to Dijkstra: a program is just
one way of apprehending a truth in applied mathematics but it's also
part of that truth.
acknowledge that you are spouting nonsense.  Intuitionism is about a way
to *prove* something, not about generalisations.  Most mathematical

"Intuitionism is about a way to *prove* something" is incredibly poor
writing even if transliterated from Dutch:

* Why is it "about a way" and not "a way"?

* And are you seriously claiming that intuitionists wanted to prove
"something", at least one thing, or are you using the English idiom
that means a person with an inferiority complex, such as some Dutch
guy making a fool of himself, is out to "prove something"? Actually,
their programme was to prove "everything true" without using the
excluded middle.
generalisations are not valid in intuitionism because there is no
constructive proof.

 > Actually, programmers who aren't socialized by corporate fear can
 > intuit that the computer, like a geometrical diagram, has essential
 > and accidental features, for the same reason intelligent students in
 > geometry class don't worry about the thickness of the lines they have
 > drawn using straightedge and compass in geometrical construction.

That is indeed the way trisection proofs are worked out.  Sheesh, can you
not get anything right?

I don't know, but it sounds to me that you were not educated in
mathematics at all. Geometrical constructions use an unmarked
straightedge and a compass (a circle drawing tool, not a direction
finder): http://mathworld.wolfram.com/GeometricConstruction.html.

If you insist on interrupting these conversations with news about
outdated computers that you happened to have worked on and complete
disinformation posted in order to participate in campaigns of personal
destruction...you're going to look the fool.
 
S

spinoza1111

spinoza1111wrote:


It isn't a restriction, it is a minimum.



The joys of a single platform language.

Damn right. Calvin "Forth" Moore successfully forced all his clients
to let him use Forth, a precursor of Java and .Net, and retarget
Forth. This is said to be evil and proprietary, but it all depends
on...who is to be master, that's all.
 
S

spinoza1111

...
 > I vaguely recall that, on some Cray systems, int and long were the
 > same size, but long used more of the bits (at the cost of slower code
 > for some operations).

int used 48 bits and long used all 64 but especially the multiplication was
slow (and probably also division).

Wow, it's Computer Museum Day! Let's all mosey on down to the old
Silicon Graphics HQ building and look at old soopercomputers! Cool
bench for the lads on that one!

Seriously, the errors of the past should not force us to spout utter
nonsense.
 
S

spinoza1111

    RH> I can answer that, using what passes for his reasoning:

    RH> 1) all clear statements are true 2) therefore all unclear
    RH> statements are false 3) everything he says is unclear 4)
    RH> therefore everything he says is false

Well, that's *quite* clear, then, isn't it?

Equivocation on two different senses of clear, old boy.

I'm "unclear" as in "unclear to you", boo most assuredly hoo
But this is 'cause you don' geddit
Whereas Peter Seebach like a perfect dear said Herbie was clear
And not to him but to all the world:
This is the meaning of "he's a clear writer".
Little Petey Seebach didn't say,
Herbie is clear to me but not to thee,
Petey used "clear" in an absolute sense,
Clear in Hotspur's sense, which takes the survey of all the world
Before being hurled
As was Percy the hot into the jaws of all-devouring death.
But if Herbie was clear in the absolute sense
He helped us all to understanding,
And what is understanding? It is knowledge, not a sandwidge,
And knowledge is (it's a relief) justified true belief.
What little Petey wanted to say was unsayable so he shouldn't have
tried
He wanted to say that a teacher was teaching clearly:
He sat in the class, rolled his eyes, scratched his penis and sighed,
Filled with resentment and nameless hostility
That here was someone expressing things differently.
 
S

spinoza1111

Darn. I should have made a note of my source. Anyway, I just found a
better source (cray.com!), which confirms your correction. Thank you.


The point remains clear - that 2^31 - 1 is not as fixed a limit as the
OP seems to think.

No-one said it is, in all cases, the limit. For one thing, I said that
the TWO bounds are -2^31 and 2^31, and I said that knowing that this
is true for many platforms is something important, that should not be
concealed by some fat geek just because said Fat Bastard once had a
summer job programming a Cray.
 
S

spinoza1111

Richard Heathfield said:
In <[email protected]>,
spinoza1111wrote:



That's very nice. But the previous poster clearly said 4 byte ints in the
context of 8 bit bytes. The clue was the 2^31 bit ...

Aren't these guys a hoot? One says "four adjacent 8 bit bytes can be
used to represent -2^31..2^31-1 in twos complement" and they reply:


"Duh, I had a summer job in 1968 programming an Electrobrite E-9821
Hybrid Digital Analogue computer with ferrite core memory and it had a
word length of 18 bits, so you're wrong!"

"Duh, yeah boss, you did, and you soitainly was a great coder. Wasn't
the delay line on that machine great for storing beer?"

"D'oh, are you out of your mind? That's not a C rule! This is supposed
to be a C class! Mom!"


HERE'S A DOLLAR FOR YOU: KINDLY GET A CLUE

An Ode to CLC, by Edward G. Nilges 18 Nov 2009. Moral rights have been
asserted by the author, so shove it.

I hate to be the first to tell you,
But this is your ass, and that is your elbow.
I thought you might like to know
That all other things being equal
And all other things, the same,
Ceteris paribus, so Christ save us,
If you take careful aim,
You might be able to pull your head out of your ass and also dislodge
your elbow
From where you tried so fruitlessly
To make it go.
You know,
It's not as if it's hard, nor is it "rocket science", and we don't
need Werner von Braun, that German guy who designed all those V-2
rockets that the Reich fired with deadly effect at London at the end
of World War II, to sort you out or set you straight,
And it's not even something you ate,
It's just basic reading comprehension coupled with the milk of human
kindness, collegiality, solidarity, decency and respect,
That's all we expect.
So the next time you have a mind
My valuable time to waste
Don't be quite so in haste
To tell me to read books I have read
Or not say things I've said.
As a wise lady once was heard to have averred,
Don't pee on my leg and tell me its raining
And don't shit in my sushi and tell me it's training.
 
W

Walter Banks

spinoza1111 said:
Damn right. Calvin "Forth" Moore successfully forced all his clients
to let him use Forth, a precursor of Java and .Net, and retarget
Forth.

That is a stretch.

w..
 
C

Coos Haak

Op Wed, 18 Nov 2009 14:13:17 -0500 schreef Walter Banks:
That is a stretch.

w..

(as this geek is in my kill file, I'm writing indirectly, sorry
Walter)
The inventor Forth is called Charles or Chuck, not Calvin.
Forth is definitely no precursor of Java nor .Net.
This shows this spinach[*] guy's ignorance of programming languages,
again, as usual!

[*] There is a link in Dutch with Spinoza and spinach.
spinoza1111 never ate spinach, so his name is an insult to our great
philosopher.
 
S

spinoza1111

Op Wed, 18 Nov 2009 14:13:17 -0500 schreef Walter Banks:




(as this geek is in my kill file, I'm writing indirectly, sorry
Walter)
The inventor Forth is called Charles or Chuck, not Calvin.

Correction accepted, of mere typo. The small-minded and the creep may
take note.
Forth is definitely no precursor of Java nor .Net.

But lack of imagination is no argument. To a mere technician there is
no commonality, but in fact there is. In Forth, Java and Forth there
is indeed a commonality. It's trading off a childish interest in speed
for an adult interest in correctness, safety and the public interest
as opposed to fraud and greed.
This shows this spinach[*] guy's ignorance of programming languages,
again, as usual!

[*] There is a link in Dutch with Spinoza and spinach.spinoza1111never ate spinach, so his name is an insult to our great
philosopher.
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top