They are all educated in a prestigious university specializing in computer science.

However the good old fundamentals seem to have gone from the courses they have taken, and from the coding field in general.

What is a float number?

A binary number with a given bits allowed before the binary point and after it.

For example:

110.0

-0.00001

The former will transform to decimal as 8+4=12,

while the latter will transform to decimal as -1/32 or equivalent.

The integer part is fine from and to decimal 12 <-> 110

But the fractional part (less than 1) has a natural inaccuracy

In decimal if you have a finite fraction that could be some integer multiple of power of 1/10

0.4

or 0.44

you will find it is not possible to transform it to finite fraction on 1/2

0.4 = 0.25+0.125+(0.025) = 0.25+0.125 + 0.015625+0.0078125 +(0.0015625)

-> 0.01100110011...

Of course the computer will simply cut off from some digits after the point

Thus you if you type in a float 0.4 into the computer, it looks as if normal 0.4,

but it will show off inaccuracy at the long end if you multiply a simple integer to it, say 3.

Because the programming language knows it will generally be inaccurate and usually round the last digit before presentation.

As you magnify the discrepancy by the multiplication, the programming language tells the little secret off.

The solution?

Almost all programming language and traditional database have a "decimal" number type.

A "decimal" number is actually two - the integer of the the number string, and the number of figures after the decimal point.

3.14 = Dec(314,2)

Thus the decimal is perfect for financial calculations to store, plus, minus or multiply.

New members are welcome but, if you had read my post carefully, you would realise that yours is close to unacceptable too. Please read this:

http://www.mathisfunforum.com/misc.php?action=rules

Bob

]]>Welcome to the forum.

I've taught computer science to A level and no calculus was required. Working in number bases other than decimal would be useful eg. binary, hexadecimal maybe octal. I had done logic (sometimes called propositional calculus) at university and this was very useful for understanding NAND gates and FLIPFLOPs for example.

Bob

]]>George,Y wrote:If both of them succeeded, the mistake is located in main

I do not get your point, can you please explain it?

The program now needs an input "accuracy" to start running.

I suggest to cancel this input first and set an accuracy inside the code.

Compile and test it.

]]>bobbym wrote:I may have been a bit hasty when I wrote that. I meant to say a lot better.

And the truth shall set you free . . . good one!

He has passed away.

]]>I was also reading [this](http://library.cmi.ac.in/cgi-bin/koha/opac-detail.pl?biblionumber=10125&query_desc=kw%2Cwrdl%3A%20mathematica%20programming) which seems pretty good.

]]>Leesajohnson* is probably not a bot. This person put a advert for tutoring services in their signature, which I removed. The administrators and moderators have discussed this growing problem but decided not to ban automatically but rather to remove the advert and wait to see what the member does next.

Some ago a person joined to tell us about some new mathematical research they had done and included a link to their book sale page. The work was genuine but the advert broke our rules. The person agreed to make a pdf of their work available to MIF members for free and that seemed to be a good compromise.

Some cases are hard to determine such as the recent bit coin maths puzzle post. Do I want to seem to encourage bit coin? But the puzzle was one that members might want to try. So I deleted the link but kept the puzzle.

Bob

ps. * Also I noticed 6 English grammar and spelling faults in that post. What sort of advert is it when the 'tutor' cannot write good English?

Make a habit of study

ingmathand thiswill make you proficient in this subject. It is good to studyfrombooks and get tuition from expert tutors,full stop / new sentence starting with 'This'is the indication ofreplace 'of' with 'for a'better future.pps. On the other hand if this is from a bot, then it's entirely appropriate to post it in 'computational math'.

Yes. I am wary of these suspicious people posting some psuedoadvertisements.

And so many [sic]s, making me [sic]!

pps. Hmmmm. Indeed.

I do not understand what you want.

]]>```
SequenceLimit[{-0.5`, -0.5833333333333334`, -0.6345238095238095`, \
-0.6628718503718504`, -0.6777662022075269`, -0.685395708269249`, \
-0.6892561888834033`, -0.691197870228108`, -0.6921715717324427`, \
-0.6926591377284108`}]
```

The amount of math and other things stuffed into mathematica is unbelievable.

]]>