Arithmetic problem

J

jaysome

Don't let yourself be brain washed by Micro$loth. scanf has NOT
been deprecated. scanf_s is NOT a method, it is a non-standard
function. There is a draft technical report n1146.pdf describing
these things.

Using such non-standard things, and such other non-standards as
stdafx.h, only locks your code into the Micro$oft way and is
counter-productive.

Counter-productive to what? Surely not to making money, as you so
openly imply by using terms that begin with "Micro$". Microsoft has
allowed a lot of people to make money. And at the same time they've
made money themselves and have benefited the world immensely. I seem
to recall reading what one respectfull person said about Excel in this
thread.

It can be beneficial, sometimes, to reflect upon the past and
reconsider it in the present. Such a relection may lead to newly
discovered insights, however that may be hard to swallow juxtaposed
against past beliefs.
 
C

CBFalconer

jaysome said:
Counter-productive to what? Surely not to making money, as you so
openly imply by using terms that begin with "Micro$". Microsoft has
allowed a lot of people to make money. And at the same time they've
made money themselves and have benefited the world immensely. I seem
to recall reading what one respectfull person said about Excel in this
thread.

Definitely counter-productive to making money. Your code will be
unusable on any other platform. By using proper standards you will
preserve the ability to move it unchanged in future, and will
protect yourself against the vagaries of Micro$loth. Limit the
non-standard things to isolated specific system dependant files.
Don't use such things as stdafx.h, just to save typing a few
#include lines.

Even today, your actions are cutting you off from the Linux, Unix,
and Mac worlds, not to mention the much larger embedded world.

If nothing else the non-standardisms preclude your asking for help
here, because the readership generally does not understand them, or
will act in that manner on principle.

--
"Our enemies are innovative and resourceful, and so are we.
They never stop thinking about new ways to harm our country
and our people, and neither do we." -- G. W. Bush.
"The people can always be brought to the bidding of the
leaders. All you have to do is tell them they are being
attacked and denounce the pacifists for lack of patriotism
and exposing the country to danger. It works the same way
in any country." --Hermann Goering.
 
A

Andrew Poelstra

Counter-productive to what? Surely not to making money, as you so
openly imply by using terms that begin with "Micro$". Microsoft has
allowed a lot of people to make money.
Yes, and here at clc it's all about who has the most money. No one here
cares who can actually program in C.
And at the same time they've
made money themselves and have benefited the world immensely. I seem
to recall reading what one respectfull person said about Excel in this
thread.
Uhh... how does introducing mass security exploits to the vast majority
of home users while at the same time exploiting its market share to keep
every single standard that has come along from acceptance. I'm referring
mainly to web standards here, but there are many, many other examples.
It can be beneficial, sometimes, to reflect upon the past and
reconsider it in the present. Such a relection may lead to newly
discovered insights, however that may be hard to swallow juxtaposed
against past beliefs.
No, thinking about M$'s history just makes me angry.
 
N

Nelu

Counter-productive to what? Surely not to making money, as you so
openly imply by using terms that begin with "Micro$". Microsoft has
allowed a lot of people to make money. And at the same time they've
made money themselves and have benefited the world immensely. I seem
to recall reading what one respectfull person said about Excel in this
thread.

It can be beneficial, sometimes, to reflect upon the past and
reconsider it in the present. Such a relection may lead to newly
discovered insights, however that may be hard to swallow juxtaposed
against past beliefs.

This group is about C not about making money using MS tools.
Plus, I'm pretty sure that last year a lot of companies lost a lot
of money because of the viruses. You can also consider the loss of
the companies locked out of the market because of the monopolistic
behavior of MS.

But this is c.l.c. So, the problem is not the money. :)
 
K

Kevin D. Quitt

Any ideas?

It has nothing to do with C, and everything to do with a fundamental problem with radix
notation and the fact that not all values can be perfectly represented in finite-length
radix representation for all integer radices.

(In your case, there is no exact representation of decimal 0.1 in binary radix notation.

<ftp://ftp.quitt.net/outgoing/goldbergFollowup.pdf>
 
D

Dann Corbit

Schizoid Man said:
Hi Coos,

I figured that out, albeit after I posted my message.

The function I'm trying to evaluate is Combin(n,r) = factorial(n) /
(factorial (n-r) * factorial (r)).

For some reason, C is blowing up for numbers like Combin(350,170), whereas
Excel is computing these large numbers quite easily. Any suggestions?

A few days ago, I posted a link to a combination table for combinations up
to 1000 elements.
I tweaked it a bit so that it should compile on just about any system now.
If some constant blows your compiler's mind, you can cut off the
computations at that point. Certainly Combin(350,170) will not pose a
problem.
http://cap.connx.com/chess-engines/new-approach/pas.c.bz2

The compressed source code is 15 MB, but you can cut it back to only the
size that you need.

Here is the program that generates the tables:
http://cap.connx.com/chess-engines/new-approach/pascal.exe.bz2

You can use it to generate the 1/2 Pascal's triangle data for any set size
you like.

It uses a library called MIRACL to generate the tables (it is an extended
precision rational number C++ class library).
 

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

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,969
Members
47,524
Latest member
ecomwebdesign

Latest Threads

Top