Manipulating with large numbers in C

K

Keith Thompson

jacob navia said:
Richard Heathfield a écrit :

I fail to see why supporting 128 bit integers "damages my reputation".

It doesn't, and nobody has ever said it did. You can do whatever you
like with your compiler and I applaud you for doing so (though I have
no use for it myself, since I don't do any win32-specific
programming).

It is your attitude and your behavior in this newsgroup that is
damaging your reputation, as well as your apparent in ability to
understand repeated explanations. Perhaps I should try explaining
this to you in words of one syllable.
lcc-win32 has a lot of numeric types, and gives the user the possibility
of writing his/her own numeric types. You may disagree with how it is
done, or whether at all should be done. You are entitled to your
opinion.

Nobody has said you shouldn't implement anything you like in your
compiler.
The "focus of this group" is nowhere stated, this group has no chart
and usenet is free. Yes, there is a group of people that think that
all improvements that compilers do to the language or to the run time
are to be banned and reduce C to a dead language, ready to be taken
over by C++.

What will it take for you to realize that *nobody has said that*?
Even such a simple thing like 128 bit integers provokes endless
polemic, without any substantive arguments of your part. Why should
128 bit integers be banned? You do not say, and stay (as always)
discussing about what is on topic or not, never about whether
something is correct or incorrect or whether there is any
advantage/disadvantage for using it.

Why are 128 bit integers OFF TOPIC here?

Because you say so?

You can, if you like, implement 128-bit integers without even using an
extension. You can make your "long long" type 128 bits; for example,
you might have:

char 8 bits
short 16 bits
int 32 bits
long 64 bits
long long 128 bits

and nobody here would have the slightest problem with it.

Or you could keep long long as 64 bits and provide one or more
"extended integer types", as described in C99 6.2.5. You could call
your 128-bit signed type something like __int128_t, and your 128-bit
unsigned type __uint128_t. No special header would be required.
Presumably int128_t and intmax_t iin <inttypes.h> would be typedefs
for __int128_t; likewise for the unsigned version. Again, this would
be entirely within the standard, and nobody here would complain (but
of course we would point out that any code that depends on the
existence of a 128-bit type is not portable to any implementation that
doesn't support it).

Or, if you prefer it for some reason, you can provide 128-bit types
using a compiler extension, and require a system-specific header for
any code that uses them. This is a perfectly valid extension, and
nobody has a problem with you implementing such a thing in your
compiler.

The *only* problem is your insistence on pushing your own exensions in
this newsgroup, and whining about the fact that they haven't been
added to the standard.
Portability is one of the many factors that rule software
construction, as you may know. Usage is another. Try to write a 128
bit library and
you will se that is much more easy to use lcc-win32's library.

If I want 128-bit integers, I can find an existing portable library
that implements them, or I can use a library that provides arbitrary
multiple-precision types (at the expense of some loss of performance),
or (with some difficulty) I can write one myself. Using your
lcc-win32 library is not an option for me because I'm not interested
in writing code that I can run only on win32 systems.
And please keep in mind that portability at all costs is nonsense.

Of course it is. Portability at *some* cost is perfectly sensible,
though.

It's true the comp.lang.c has no charter, for the simple reason that
it was created (as net.lang.c) before newsgroup charters existed.
There is a general consensus that the the topic of this newsgroup is
the C language as defined by the ISO standard(s), and that discussions
of system-specific extensions are off-topic.

If you don't like the way this newsgroup works, perhaps you should
consider posting in comp.compilers.lcc. You practically have your own
newsgroup; why on Earth do you feel the need to come here and tell us
how to run this one?

Once again, in case I still haven't gotten through to you. Nobody has
any problem with you implementing extensions in your own compiler.
Nobody says that non-portable code is evil; when it's necessary,
there's nothing wrong with it. Our only concern is the topicality of
posts to this newsgroup. Many of us find it useful to have a
newsgroup that only discusses the C language as defined by the
standard. Why do you have a problem with that?
 
B

Ben Pfaff

jacob navia said:
Ben Pfaff a icrit :

Well, I think you are 99% right actually.

The only problem is that it would be enabled by default...

It would? <stdint.h> just provides a typedef that isn't visible
without including it. Presumably you'd use something like
__int128 for the underlying type.
But in any case intXXX_t is a reserved word isn't it?

In C99, yes.
 
K

Keith Thompson

jacob navia said:
Ben Pfaff a écrit :

Well, I think you are 99% right actually.

The only problem is that it would be enabled by default...

And why is that a problem?

You can provide a compiler option that controls whether your 128-bit
types are supported. Your compiler invoked with that option would
then effectively be a different implementation than your compiler
invoked without the option. Both implementations could be conforming.
But in any case intXXX_t is a reserved word isn't it?

It's a reserved identifier (obviously not a keyword), and it's
reserved for exactly what you're doing.
The rationale for making it optional is avoiding clobbering some other
int128 type that may exist in user name space. But int128_t is
probably reserved.

You have an int64_t in your <stdint.h>, right? Why would adding
int128_t to your <stdint.h> be a problem?
 
R

Rod Pemberton

jacob navia said:
The "focus of this group" is nowhere stated, this group has no chart and
usenet is free. Yes, there is a group of people that think that all
improvements that compilers do to the language or to the run time
are to be banned and reduce C to a dead language, ready to be taken over
by C++.

Say it again! You can write them off as quixotic, for they have never read
Don Quixote...


Compare this statement from John Bode with a joke from Ron White's "You
Can't Fix Stupid!" comedy tour:

John Bode said:
I've been following this newsgroup since around 1994, and I have to
say, after 12 years of people asking the same exact questions the same
exact way, it's hard to stay civil.


Paraphrasing "Ron White":

RW: "I was at an army base in Louisiana and mentioned there were 40,000 men
stationed there. At which point, a drunk woman stood up and said, 'Yeah,
they're all bad lays.' To which I responded, ' I'd think that after, I
don't know, the 39,000th F__k you'd think the problem might be you.'"



Rod Pemberton
 
R

Richard Heathfield

Rod Pemberton said:
Compare this statement from John Bode with a joke from Ron White's "You
Can't Fix Stupid!" comedy tour:




Paraphrasing "Ron White":

RW: "I was at an army base in Louisiana and mentioned there were 40,000
men
stationed there. At which point, a drunk woman stood up and said, 'Yeah,
they're all bad lays.' To which I responded, ' I'd think that after, I
don't know, the 39,000th F__k you'd think the problem might be you.'"

It seems to me that, after only about three months of using this newsgroup
(according to Google's archives), you have already found it hard to stay
civil. So you prove John Bode's point nicely.
 
R

Rod Pemberton

Richard Heathfield said:
Rod Pemberton said:


It seems to me that, after only about three months of using this newsgroup
(according to Google's archives), you have already found it hard to stay
civil. So you prove John Bode's point nicely.

Your comprehension is _low_. He said "after 12 years", "it's hard to stay
civil" because "of people people asking the same exact questions the same
exact way." I've only asked one question. And, I sure didn't do so just
now. Which means your declaration that I "prove John Bode's point nicely"
is a lie.


Rod Pemberton
 
R

Richard Heathfield

Rod Pemberton said:
Your comprehension is _low_.

No, it isn't.
He said "after 12 years", "it's hard to
stay civil" because "of people people asking the same exact questions the
same
exact way."
Yes.

I've only asked one question.

Irrelevant. You have still shown incivility, without even the excuse of 12
years of answering "the same exact questions" - thus demonstrating John's
point that it is hard to stay civil.
And, I sure didn't do so just now.

Irrelevant. You still showed incivility.
Which means your declaration that I "prove John Bode's point nicely"
is a lie.

No, your objection merely demonstrates that you don't understand plain
English, and your (unthinking and misplaced) accusation of mendacity merely
confirms John's point that it is hard to remain civil.
 
C

CBFalconer

Richard said:
Rod Pemberton said:
.... snip ...

It seems to me that, after only about three months of using this
newsgroup (according to Google's archives), you have already found
it hard to stay civil. So you prove John Bode's point nicely.

This seems to confirm my accuracy in plonking at about the 2 week
mark. I wonder how much invective and other foolishness I have
avoided, not to mention bandwidth.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 
R

Rod Pemberton

Richard Heathfield said:
Rod Pemberton said:


No, it isn't.

Yes, it is.
Irrelevant. You have still shown incivility, without even the excuse of 12
years of answering "the same exact questions" - thus demonstrating John's
point that it is hard to stay civil.

He never said anything about "answered" questions for 12 years, only
"asking" questions. (low comprehension on your part).
Irrelevant. You still showed incivility.

Irrelevant. His point has to do with repetitive "asking the same exact
questions." Not inaccurately percieved incivility without asking questions
(again, low comprehension on your part).
No, your objection merely demonstrates that you don't understand plain
English, and your (unthinking and misplaced) accusation of mendacity merely
confirms John's point that it is hard to remain civil.

No, your objections demonstrates consistently low comprehension, failure to
accept the truth, refusal to accept the fact that you attempted to project a
falsehood, and ignorance of John's statement.


Rod Pemberton
 
J

John Bode

Rod said:
Say it again! You can write them off as quixotic, for they have never read
Don Quixote...


Compare this statement from John Bode with a joke from Ron White's "You
Can't Fix Stupid!" comedy tour:




Paraphrasing "Ron White":

RW: "I was at an army base in Louisiana and mentioned there were 40,000 men
stationed there. At which point, a drunk woman stood up and said, 'Yeah,
they're all bad lays.' To which I responded, ' I'd think that after, I
don't know, the 39,000th F__k you'd think the problem might be you.'"



Rod Pemberton

** plonk **
 

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
474,183
Messages
2,570,966
Members
47,514
Latest member
AdeleGelle

Latest Threads

Top